mirror of
https://github.com/python/cpython.git
synced 2025-11-17 01:25:57 +00:00
Patch from Perry Stoll: typo fix, make sure we only compile .py files.
This commit is contained in:
parent
5d60fcf02a
commit
440e2f51ea
2 changed files with 18 additions and 12 deletions
|
|
@ -9,7 +9,7 @@ from distutils.util import copy_tree
|
||||||
class InstallPy (Command):
|
class InstallPy (Command):
|
||||||
|
|
||||||
options = [('dir=', 'd', "directory to install to"),
|
options = [('dir=', 'd', "directory to install to"),
|
||||||
('build-dir=' 'b', "build directory (where to install from)"),
|
('build-dir=','b', "build directory (where to install from)"),
|
||||||
('compile', 'c', "compile .py to .pyc"),
|
('compile', 'c', "compile .py to .pyc"),
|
||||||
('optimize', 'o', "compile .py to .pyo (optimized)"),
|
('optimize', 'o', "compile .py to .pyo (optimized)"),
|
||||||
]
|
]
|
||||||
|
|
@ -54,6 +54,9 @@ class InstallPy (Command):
|
||||||
|
|
||||||
for f in outfiles:
|
for f in outfiles:
|
||||||
# XXX can't assume this filename mapping!
|
# XXX can't assume this filename mapping!
|
||||||
|
|
||||||
|
# only compile the file if it is actually a .py file
|
||||||
|
if f[-3:] == '.py':
|
||||||
out_fn = string.replace (f, '.py', '.pyc')
|
out_fn = string.replace (f, '.py', '.pyc')
|
||||||
|
|
||||||
self.make_file (f, out_fn, compile, (f,),
|
self.make_file (f, out_fn, compile, (f,),
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from distutils.util import copy_tree
|
||||||
class InstallPy (Command):
|
class InstallPy (Command):
|
||||||
|
|
||||||
options = [('dir=', 'd', "directory to install to"),
|
options = [('dir=', 'd', "directory to install to"),
|
||||||
('build-dir=' 'b', "build directory (where to install from)"),
|
('build-dir=','b', "build directory (where to install from)"),
|
||||||
('compile', 'c', "compile .py to .pyc"),
|
('compile', 'c', "compile .py to .pyc"),
|
||||||
('optimize', 'o', "compile .py to .pyo (optimized)"),
|
('optimize', 'o', "compile .py to .pyo (optimized)"),
|
||||||
]
|
]
|
||||||
|
|
@ -54,6 +54,9 @@ class InstallPy (Command):
|
||||||
|
|
||||||
for f in outfiles:
|
for f in outfiles:
|
||||||
# XXX can't assume this filename mapping!
|
# XXX can't assume this filename mapping!
|
||||||
|
|
||||||
|
# only compile the file if it is actually a .py file
|
||||||
|
if f[-3:] == '.py':
|
||||||
out_fn = string.replace (f, '.py', '.pyc')
|
out_fn = string.replace (f, '.py', '.pyc')
|
||||||
|
|
||||||
self.make_file (f, out_fn, compile, (f,),
|
self.make_file (f, out_fn, compile, (f,),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue