Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 697842 | Differences between
and this patch

Collapse All | Expand All

(-)a/Lib/distutils/command/build_py.py (-4 / +4 lines)
Lines 315-323 class build_py (Command): Link Here
315
                if self.compile:
315
                if self.compile:
316
                    outputs.append(importlib.util.cache_from_source(
316
                    outputs.append(importlib.util.cache_from_source(
317
                        filename, optimization=''))
317
                        filename, optimization=''))
318
                if self.optimize > 0:
318
                for opt in range(1, self.optimize + 1):
319
                    outputs.append(importlib.util.cache_from_source(
319
                    outputs.append(importlib.util.cache_from_source(
320
                        filename, optimization=self.optimize))
320
                        filename, optimization=opt))
321
321
322
        outputs += [
322
        outputs += [
323
            os.path.join(build_dir, filename)
323
            os.path.join(build_dir, filename)
Lines 387-394 class build_py (Command): Link Here
387
        if self.compile:
387
        if self.compile:
388
            byte_compile(files, optimize=0,
388
            byte_compile(files, optimize=0,
389
                         force=self.force, prefix=prefix, dry_run=self.dry_run)
389
                         force=self.force, prefix=prefix, dry_run=self.dry_run)
390
        if self.optimize > 0:
390
        for opt in range(1, self.optimize + 1):
391
            byte_compile(files, optimize=self.optimize,
391
            byte_compile(files, optimize=opt,
392
                         force=self.force, prefix=prefix, dry_run=self.dry_run)
392
                         force=self.force, prefix=prefix, dry_run=self.dry_run)
393
393
394
class build_py_2to3(build_py, Mixin2to3):
394
class build_py_2to3(build_py, Mixin2to3):
(-)a/Lib/distutils/command/install_lib.py (-7 / +6 lines)
Lines 24-31 class install_lib(Command): Link Here
24
    #   2) compile .pyc only (--compile --no-optimize; default)
24
    #   2) compile .pyc only (--compile --no-optimize; default)
25
    #   3) compile .pyc and "opt-1" .pyc (--compile --optimize)
25
    #   3) compile .pyc and "opt-1" .pyc (--compile --optimize)
26
    #   4) compile "opt-1" .pyc only (--no-compile --optimize)
26
    #   4) compile "opt-1" .pyc only (--no-compile --optimize)
27
    #   5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
27
    #   5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more)
28
    #   6) compile "opt-2" .pyc only (--no-compile --optimize-more)
28
    #   6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more)
29
    #
29
    #
30
    # The UI for this is two options, 'compile' and 'optimize'.
30
    # The UI for this is two options, 'compile' and 'optimize'.
31
    # 'compile' is strictly boolean, and only decides whether to
31
    # 'compile' is strictly boolean, and only decides whether to
Lines 132-139 class install_lib(Command): Link Here
132
            byte_compile(files, optimize=0,
132
            byte_compile(files, optimize=0,
133
                         force=self.force, prefix=install_root,
133
                         force=self.force, prefix=install_root,
134
                         dry_run=self.dry_run)
134
                         dry_run=self.dry_run)
135
        if self.optimize > 0:
135
        for opt in range(1, self.optimize + 1):
136
            byte_compile(files, optimize=self.optimize,
136
            byte_compile(files, optimize=opt,
137
                         force=self.force, prefix=install_root,
137
                         force=self.force, prefix=install_root,
138
                         verbose=self.verbose, dry_run=self.dry_run)
138
                         verbose=self.verbose, dry_run=self.dry_run)
139
139
Lines 167-175 class install_lib(Command): Link Here
167
            if self.compile:
167
            if self.compile:
168
                bytecode_files.append(importlib.util.cache_from_source(
168
                bytecode_files.append(importlib.util.cache_from_source(
169
                    py_file, optimization=''))
169
                    py_file, optimization=''))
170
            if self.optimize > 0:
170
            for opt in range(1, self.optimize + 1):
171
                bytecode_files.append(importlib.util.cache_from_source(
171
                bytecode_files.append(importlib.util.cache_from_source(
172
                    py_file, optimization=self.optimize))
172
                    py_file, optimization=opt))
173
173
174
        return bytecode_files
174
        return bytecode_files
175
175
176
- 

Return to bug 697842