|
6 | 6 | from os import environ, utime |
7 | 7 | from os.path import dirname, exists, join |
8 | 8 | from pathlib import Path |
9 | | -from shutil import copy2 |
| 9 | +import shutil |
10 | 10 |
|
11 | 11 | from pythonforandroid.logger import info, warning, shprint |
12 | 12 | from pythonforandroid.patching import version_starts_with |
@@ -73,7 +73,7 @@ class Python3Recipe(TargetPythonRecipe): |
73 | 73 | ('patches/py3.8.1.patch', version_starts_with("3.9")) |
74 | 74 | ] |
75 | 75 |
|
76 | | - if sh.which('lld') is not None: |
| 76 | + if shutil.which('lld') is not None: |
77 | 77 | patches = patches + [ |
78 | 78 | ("patches/py3.7.1_fix_cortex_a8.patch", version_starts_with("3.7")), |
79 | 79 | ("patches/py3.8.1_fix_cortex_a8.patch", version_starts_with("3.8")), |
@@ -208,7 +208,7 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True): |
208 | 208 | ) |
209 | 209 |
|
210 | 210 | env['LDFLAGS'] = env.get('LDFLAGS', '') |
211 | | - if sh.which('lld') is not None: |
| 211 | + if shutil.which('lld') is not None: |
212 | 212 | # Note: The -L. is to fix a bug in python 3.7. |
213 | 213 | # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234409 |
214 | 214 | env['LDFLAGS'] += ' -L. -fuse-ld=lld' |
@@ -380,7 +380,7 @@ def create_python_bundle(self, dirn, arch): |
380 | 380 | info("Copy {} files into the bundle".format(len(module_filens))) |
381 | 381 | for filen in module_filens: |
382 | 382 | info(" - copy {}".format(filen)) |
383 | | - copy2(filen, modules_dir) |
| 383 | + shutil.copy2(filen, modules_dir) |
384 | 384 |
|
385 | 385 | # zip up the standard library |
386 | 386 | stdlib_zip = join(dirn, 'stdlib.zip') |
@@ -408,7 +408,7 @@ def create_python_bundle(self, dirn, arch): |
408 | 408 | for filen in filens: |
409 | 409 | info(" - copy {}".format(filen)) |
410 | 410 | ensure_dir(join(dirn, 'site-packages', dirname(filen))) |
411 | | - copy2(filen, join(dirn, 'site-packages', filen)) |
| 411 | + shutil.copy2(filen, join(dirn, 'site-packages', filen)) |
412 | 412 |
|
413 | 413 | # copy the python .so files into place |
414 | 414 | python_build_dir = join(self.get_build_dir(arch.arch), |
|
0 commit comments