Commit 1df6e7b1 authored by Greg Ward's avatar Greg Ward

Reduced the 'bytecompile()' method to a one-line wrapper around

'util.byte_compile()'.  Currently just reproduces the existing functionality
-- doesn't use any of the fancy features in the new 'byte_compile()'.
parent 1297b5ce
...@@ -5,6 +5,7 @@ __revision__ = "$Id$" ...@@ -5,6 +5,7 @@ __revision__ = "$Id$"
import sys, os, string import sys, os, string
from distutils.core import Command from distutils.core import Command
from distutils.dir_util import copy_tree from distutils.dir_util import copy_tree
from distutils.util import byte_compile
class install_lib (Command): class install_lib (Command):
...@@ -82,21 +83,9 @@ class install_lib (Command): ...@@ -82,21 +83,9 @@ class install_lib (Command):
return outfiles return outfiles
def bytecompile (self, files): def bytecompile (self, files):
# XXX hey! we can't control whether we optimize or not; that's up byte_compile(files,
# to the invocation of the current Python interpreter (at least force=self.force,
# according to the py_compile docs). That sucks. verbose=self.verbose, dry_run=self.dry_run)
if self.compile:
from py_compile import compile
for f in files:
# only compile the file if it is actually a .py file
if f[-3:] == '.py':
out_fn = f + (__debug__ and "c" or "o")
compile_msg = "byte-compiling %s to %s" % \
(f, os.path.basename(out_fn))
skip_msg = "skipping byte-compilation of %s" % f
self.make_file(f, out_fn, compile, (f,),
compile_msg, skip_msg)
# -- Utility methods ----------------------------------------------- # -- Utility methods -----------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment