summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2025-07-26 11:26:55 +0300
committerAlexander Golubev <fatzer2@gmail.com>2025-07-28 16:21:16 +0300
commit5d29a06806ad38ceac4a82b73022f60de9eaa9f1 (patch)
tree6e9197b5930b062befd2896236f7bc59a3c0eb06
parentd25660c894ec70a75f4d292a1c8cdc4694818c69 (diff)
downloadpytdeextensions-5d29a068.tar.gz
pytdeextensions-5d29a068.zip
Avoid byte-compiling in case it is disabled
Signed-off-by: Alexander Golubev <fatzer2@gmail.com> (cherry picked from commit 32d9a1e50ba6a0cc72e546934bf80d6361ad55f9)
-rw-r--r--src/tdedistutils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tdedistutils.py b/src/tdedistutils.py
index 3a03007..5b5041d 100644
--- a/src/tdedistutils.py
+++ b/src/tdedistutils.py
@@ -365,9 +365,10 @@ class InstallApplicationDataAndLinks(install_data):
prefix = prefix + os.sep
self.outfiles.extend(compile_tqtdesigner(self.outfiles, force=1, prefix=prefix, base_dir=install_cmd.prefix, dry_run=self.dry_run))
- # Byte compile the .py files
- from distutils.util import byte_compile
- byte_compile(self.outfiles, optimize=0, force=1, prefix=prefix, base_dir=install_cmd.prefix, dry_run=self.dry_run)
+ if not sys.dont_write_bytecode:
+ # Byte compile the .py files (unless it is disabled)
+ from distutils.util import byte_compile
+ byte_compile(self.outfiles, optimize=0, force=1, prefix=prefix, base_dir=install_cmd.prefix, dry_run=self.dry_run)
# Add the .pyc files to the list of outfiles.
self.outfiles.extend( [item+'c' for item in self.outfiles if item.endswith('.py')] )