You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
Fix build with python 3.
|
|
https://github.com/imageworks/Field3D/issues/103
|
|
https://github.com/imageworks/Field3D/pull/104
|
|
--- BuildSupport.py.orig 2020-03-11 10:54:36.000000000 -0500
|
|
+++ BuildSupport.py 2023-02-21 21:53:45.000000000 -0600
|
|
@@ -250,13 +250,13 @@
|
|
# ------------------------------------------------------------------------------
|
|
|
|
def numCPUs():
|
|
- if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
|
|
+ if "SC_NPROCESSORS_ONLN" in os.sysconf_names:
|
|
nCPUs = os.sysconf("SC_NPROCESSORS_ONLN")
|
|
if isinstance(nCPUs, int) and nCPUs > 0:
|
|
return nCPUs
|
|
else:
|
|
return int(os.popen2("sysctl -n hw.ncpu")[1].read())
|
|
- if os.environ.has_key("NUMBER_OF_PROCESSORS"):
|
|
+ if "NUMBER_OF_PROCESSORS" in os.environ:
|
|
nCPUs = int(os.environ["NUMBER_OF_PROCESSORS"]);
|
|
if nCPUs > 0:
|
|
return nCPUs
|
|
@@ -273,14 +273,14 @@
|
|
cmd = "install_name_tool "
|
|
cmd += "-id " + os.path.abspath(tgtName) + " "
|
|
cmd += tgtName
|
|
- print cmd
|
|
+ print(cmd)
|
|
os.system(cmd)
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
def bakeMathLibHeader(target, source, env):
|
|
if len(target) != 1 or len(source) != 1:
|
|
- print "Wrong number of arguments to bakeTypesIncludeFile"
|
|
+ print("Wrong number of arguments to bakeTypesIncludeFile")
|
|
return
|
|
out = open(str(target[0]), "w")
|
|
inFile = open(str(source[0]))
|