From 7f80ce875d688fc019b74a84508970b26c48a90b Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sat, 26 Jul 2025 11:26:55 +0300 Subject: [PATCH] Avoid byte-compiling in case it is disabled Signed-off-by: Alexander Golubev --- src/tdedistutils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tdedistutils.py b/src/tdedistutils.py index aade55e..e5c1e40 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')] ) -- 2.49.1