waf: fixes for python 3.7

This commit is contained in:
Andrew Tridgell 2018-08-07 12:39:40 +10:00
parent 27ded1c12b
commit 36af9eecdf
2 changed files with 3 additions and 6 deletions

View File

@ -200,10 +200,6 @@ class cmake_build_task(Task.Task):
def keyword(self): def keyword(self):
return 'CMake Build' return 'CMake Build'
# allow tasks to depend on possible headers or other resources if the user
# declares outputs for the cmake build
cmake_build_task = Task.update_outputs(cmake_build_task)
cmake_build_task.original_post_run = cmake_build_task.post_run cmake_build_task.original_post_run = cmake_build_task.post_run
def _cmake_build_task_post_run(self): def _cmake_build_task_post_run(self):
self.output_patterns = Utils.to_list(self.output_patterns) self.output_patterns = Utils.to_list(self.output_patterns)

View File

@ -155,11 +155,12 @@ configuration in order to save typing.
def _collect_autoconfig_files(cfg): def _collect_autoconfig_files(cfg):
for m in sys.modules.values(): for m in sys.modules.values():
paths = [] paths = []
if hasattr(m, '__file__'): if hasattr(m, '__file__') and m.__file__ is not None:
paths.append(m.__file__) paths.append(m.__file__)
elif hasattr(m, '__path__'): elif hasattr(m, '__path__'):
for p in m.__path__: for p in m.__path__:
paths.append(p) if p is not None:
paths.append(p)
for p in paths: for p in paths:
if p in cfg.files or not os.path.isfile(p): if p in cfg.files or not os.path.isfile(p):