diff options
Diffstat (limited to 'third_party/waf/waflib/Tools/python.py')
-rw-r--r-- | third_party/waf/waflib/Tools/python.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py index 587fc9c199a..10e407387d3 100644 --- a/third_party/waf/waflib/Tools/python.py +++ b/third_party/waf/waflib/Tools/python.py @@ -23,7 +23,7 @@ Support for Python, detect the headers and libraries and provide """ import os, sys -from waflib import Utils, Options, Errors, Logs, Task, Node +from waflib import Errors, Logs, Node, Options, Task, Utils from waflib.TaskGen import extension, before_method, after_method, feature from waflib.Configure import conf @@ -54,7 +54,7 @@ import sys, py_compile py_compile.compile(sys.argv[1], sys.argv[2], sys.argv[3], True) ''' """ -Piece of Python code used in :py:func:`waflib.Tools.python.pytask` for byte-compiling python files +Piece of Python code used in :py:class:`waflib.Tools.python.pyo` and :py:class:`waflib.Tools.python.pyc` for byte-compiling python files """ DISTUTILS_IMP = ['from distutils.sysconfig import get_config_var, get_python_lib'] @@ -83,7 +83,7 @@ def process_py(self, node): """ Add signature of .py file, so it will be byte-compiled when necessary """ - assert(getattr(self, 'install_path')), 'add features="py"' + assert(hasattr(self, 'install_path')), 'add features="py"' # where to install the python file if self.install_path: @@ -557,7 +557,7 @@ def check_python_module(conf, module_name, condition=''): conf.start_msg(msg) try: ret = conf.cmd_and_log(conf.env.PYTHON + ['-c', PYTHON_MODULE_TEMPLATE % module_name]) - except Exception: + except Errors.WafError: conf.end_msg(False) conf.fatal('Could not find the python module %r' % module_name) @@ -596,7 +596,7 @@ def configure(conf): v.NOPYCACHE=Options.options.nopycache if not v.PYTHON: - v.PYTHON = getattr(Options.options, 'python', None) or sys.executable + v.PYTHON = [getattr(Options.options, 'python', None) or sys.executable] v.PYTHON = Utils.to_list(v.PYTHON) conf.find_program('python', var='PYTHON') @@ -628,3 +628,4 @@ def options(opt): help='Installation path for python modules (py, platform-independent .py and .pyc files)') pyopt.add_option('--pythonarchdir', dest='pythonarchdir', help='Installation path for python extension (pyext, platform-dependent .so or .dylib files)') + |