Leonid Plyushch
5 years ago
3 changed files with 68 additions and 22 deletions
@ -0,0 +1,57 @@ |
|||
From 84fdbc156ed424d030686de350fbfc6c3593263f Mon Sep 17 00:00:00 2001 |
|||
Message-Id: <84fdbc156ed424d030686de350fbfc6c3593263f.1537028533.git.jan.steffens@gmail.com> |
|||
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> |
|||
Date: Sat, 15 Sep 2018 18:22:06 +0200 |
|||
Subject: [PATCH] compileall: Fix ddir when recursing |
|||
|
|||
---
|
|||
Lib/compileall.py | 14 +++++++++----- |
|||
1 file changed, 9 insertions(+), 5 deletions(-) |
|||
|
|||
diff --git a/Lib/compileall.py b/Lib/compileall.py
|
|||
index 72592126d7..70e246fd96 100644
|
|||
--- a/Lib/compileall.py
|
|||
+++ b/Lib/compileall.py
|
|||
@@ -45,12 +45,16 @@ def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0):
|
|||
else: |
|||
dfile = None |
|||
if not os.path.isdir(fullname): |
|||
- yield fullname
|
|||
+ yield fullname, ddir
|
|||
elif (maxlevels > 0 and name != os.curdir and name != os.pardir and |
|||
os.path.isdir(fullname) and not os.path.islink(fullname)): |
|||
yield from _walk_dir(fullname, ddir=dfile, |
|||
maxlevels=maxlevels - 1, quiet=quiet) |
|||
|
|||
+def _compile_one(file_ddir, *args, **kwargs):
|
|||
+ file, ddir = file_ddir
|
|||
+ return compile_file(file, ddir, *args, **kwargs)
|
|||
+
|
|||
def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, |
|||
quiet=0, legacy=False, optimize=-1, workers=1, |
|||
invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): |
|||
@@ -79,17 +83,17 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
|
|||
if workers is not None and workers != 1 and ProcessPoolExecutor is not None: |
|||
workers = workers or None |
|||
with ProcessPoolExecutor(max_workers=workers) as executor: |
|||
- results = executor.map(partial(compile_file,
|
|||
- ddir=ddir, force=force,
|
|||
+ results = executor.map(partial(_compile_one,
|
|||
+ force=force,
|
|||
rx=rx, quiet=quiet, |
|||
legacy=legacy, |
|||
optimize=optimize, |
|||
invalidation_mode=invalidation_mode), |
|||
files) |
|||
success = min(results, default=True) |
|||
else: |
|||
- for file in files:
|
|||
- if not compile_file(file, ddir, force, rx, quiet,
|
|||
+ for file_ddir in files:
|
|||
+ if not _compile_one(file_ddir, force, rx, quiet,
|
|||
legacy, optimize, invalidation_mode): |
|||
success = False |
|||
return success |
|||
--
|
|||
2.18.0 |
|||
|
@ -1,13 +1,13 @@ |
|||
diff -u -r ../Python-3.5.0/setup.py ./setup.py
|
|||
--- ../Python-3.5.0/setup.py 2015-09-13 07:41:26.000000000 -0400
|
|||
+++ ./setup.py 2015-11-07 17:31:45.332321322 -0500
|
|||
@@ -661,7 +663,8 @@
|
|||
diff -uNr Python-3.8.0/setup.py Python-3.8.0.mod/setup.py
|
|||
--- Python-3.8.0/setup.py 2019-10-14 16:34:47.000000000 +0300
|
|||
+++ Python-3.8.0.mod/setup.py 2019-11-17 21:16:46.524157731 +0200
|
|||
@@ -824,7 +824,8 @@
|
|||
|
|||
# Lance Ellinghaus's syslog module |
|||
# syslog daemon interface |
|||
- exts.append( Extension('syslog', ['syslogmodule.c']) )
|
|||
- self.add(Extension('syslog', ['syslogmodule.c']))
|
|||
+ # Termux: Add 'log' android library since we use android logging:
|
|||
+ exts.append( Extension('syslog', ['syslogmodule.c'], libraries=['log']) )
|
|||
+ self.add(Extension('syslog', ['syslogmodule.c'], libraries=['-llog']))
|
|||
|
|||
# |
|||
# Here ends the simple stuff. From here on, modules need certain |
|||
# Python interface to subinterpreter C-API. |
|||
self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c'])) |
|||
|
Loading…
Reference in new issue