From 4d82b313b9abd5b0bce31c54bdbf6f8593985ae6 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Thu, 15 Mar 2018 01:09:21 -0400 Subject: [PATCH] forcing python3 to build4mac, for now. --- macbuild/build4mac_util.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/macbuild/build4mac_util.py b/macbuild/build4mac_util.py index 9d2e5f1ed..9113e9171 100755 --- a/macbuild/build4mac_util.py +++ b/macbuild/build4mac_util.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: utf-8 -*- #=============================================================================== @@ -21,7 +21,7 @@ try: from pathlib import Path Path().expanduser() except (ImportError,AttributeError): # python2 - from pathlib2 import Path + raise RuntimeError("Need python3 to run this script, for now...") #------------------------------------------------------------------------------- ## To import global dictionaries of different modules @@ -204,8 +204,14 @@ def WalkLibDependencyTree( dylibPath, depth=0, filter_regex=r'\t+/usr/local/opt' else: raise RuntimeError("Exceeded maximum recursion depth.") -def WalkFrameworkPaths(*frameworkPaths, filter_regex=r'\.(so|dylib)$'): +def WalkFrameworkPaths(frameworkPaths, filter_regex=r'\.(so|dylib)$'): + try: + frameworkPathsIter = iter(frameworkPaths) + except TypeError: + frameworkPathsIter = [frameworkPaths] + dependency_dict = dict() + for frameworkPath in frameworkPaths: frameworkPath = str(Path(frameworkPath)) find_grep_results = os.popen('find %s -type f | grep -E "%s"' % (frameworkPath, filter_regex)).read().split('\n')