summaryrefslogtreecommitdiff
path: root/py-compile
diff options
context:
space:
mode:
Diffstat (limited to 'py-compile')
-rwxr-xr-xpy-compile23
1 files changed, 7 insertions, 16 deletions
diff --git a/py-compile b/py-compile
index bc20391..15c834c 100755
--- a/py-compile
+++ b/py-compile
@@ -3,7 +3,8 @@
scriptversion=2011-06-08.12; # UTC
-# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free
+# Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -36,7 +37,7 @@ me=py-compile
usage_error ()
{
echo "$me: $*" >&2
- echo "Try '$me --help' for more information." >&2
+ echo "Try \`$me --help' for more information." >&2
exit 1
}
@@ -116,7 +117,7 @@ else
fi
$PYTHON -c "
-import sys, os, py_compile, imp
+import sys, os, py_compile
files = '''$files'''
@@ -129,19 +130,12 @@ for file in files.split():
continue
sys.stdout.write(file)
sys.stdout.flush()
- if hasattr(imp, 'get_tag'):
- py_compile.compile(filepath, imp.cache_from_source(filepath), path)
- else:
- py_compile.compile(filepath, filepath + 'c', path)
+ py_compile.compile(filepath, filepath + 'c', path)
sys.stdout.write('\n')" || exit $?
# this will fail for python < 1.5, but that doesn't matter ...
$PYTHON -O -c "
-import sys, os, py_compile, imp
-
-# pypy does not use .pyo optimization
-if hasattr(sys, 'pypy_translation_info'):
- sys.exit(0)
+import sys, os, py_compile
files = '''$files'''
sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
@@ -153,10 +147,7 @@ for file in files.split():
continue
sys.stdout.write(file)
sys.stdout.flush()
- if hasattr(imp, 'get_tag'):
- py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
- else:
- py_compile.compile(filepath, filepath + 'o', path)
+ py_compile.compile(filepath, filepath + 'o', path)
sys.stdout.write('\n')" 2>/dev/null || :
# Local Variables: