comparison files/patch-lib-python_2.7_sysconfig.py @ 44:ff83a2d91909

FIX: Do not try to write sysconfigdata into the currend working directory: use WRKDIR instead
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 09 Oct 2022 16:00:56 +0200
parents cb562cb4ec47
children
comparison
equal deleted inserted replaced
43:af3a2629a882 44:ff83a2d91909
1 --- lib-python/2.7/sysconfig.py.orig 2022-03-28 09:50:42 UTC 1 --- lib-python/2.7/sysconfig.py.orig 2022-03-28 09:50:42 UTC
2 +++ lib-python/2.7/sysconfig.py 2 +++ lib-python/2.7/sysconfig.py
3 @@ -382,7 +382,11 @@ def _generate_posix_vars(): 3 @@ -366,13 +366,15 @@ def _generate_posix_vars():
4 module.build_time_vars = vars
5 sys.modules[name] = module
6
7 + pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port
8 +
9 pybuilddir = 'build/lib.%s-%s' % (get_platform(), sys.version[:3])
10 + if pypy_wrkdir is not None:
11 + pybuilddir = os.path.join(pypy_wrkdir, pybuilddir)
12 if hasattr(sys, "gettotalrefcount"):
13 pybuilddir += '-pydebug'
14 - try:
15 + if not os.path.isdir(pybuilddir):
16 os.makedirs(pybuilddir)
17 - except OSError:
18 - pass
19 destfile = os.path.join(pybuilddir, name + '.py')
20
21 with open(destfile, 'wb') as f:
22 @@ -382,7 +384,10 @@ def _generate_posix_vars():
4 pprint.pprint(vars, stream=f) 23 pprint.pprint(vars, stream=f)
5 24
6 # Create file used for sys.path fixup -- see Modules/getpath.c 25 # Create file used for sys.path fixup -- see Modules/getpath.c
7 - with open('pybuilddir.txt', 'w') as f: 26 - with open('pybuilddir.txt', 'w') as f:
8 + pybuilddir_txt = 'pybuilddir.txt' 27 + pybuilddir_txt = 'pybuilddir.txt'
9 + pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port
10 + if pypy_wrkdir is not None: 28 + if pypy_wrkdir is not None:
11 + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) 29 + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt)
12 + with open(pybuilddir_txt, 'w') as f: 30 + with open(pybuilddir_txt, 'w') as f:
13 f.write(pybuilddir) 31 f.write(pybuilddir)
14 32