Skip to content

Commit

Permalink
Merge pull request #1607 from j-devel/fix-strip-bootstrap
Browse files Browse the repository at this point in the history
Fix strip in bootstrap
  • Loading branch information
inclement authored Jan 31, 2019
2 parents 71da840 + 06f2d39 commit 8c1d5c8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pythonforandroid/bootstrap.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from os.path import (join, dirname, isdir, normpath, splitext, basename)
from os import listdir, walk, sep
import sh
import shlex
import glob
import importlib
import os
Expand All @@ -9,7 +10,7 @@
from pythonforandroid.logger import (warning, shprint, info, logger,
debug)
from pythonforandroid.util import (current_directory, ensure_dir,
temp_directory, which)
temp_directory)
from pythonforandroid.recipe import Recipe


Expand Down Expand Up @@ -263,11 +264,10 @@ def strip_libraries(self, arch):
info('Python was loaded from CrystaX, skipping strip')
return
env = arch.get_env()
strip = which('arm-linux-androideabi-strip', env['PATH'])
if strip is None:
warning('Can\'t find strip in PATH...')
return
strip = sh.Command(strip)
tokens = shlex.split(env['STRIP'])
strip = sh.Command(tokens[0])
if len(tokens) > 1:
strip = strip.bake(tokens[1:])

libs_dir = join(self.dist_dir, '_python_bundle',
'_python_bundle', 'modules')
Expand All @@ -278,6 +278,8 @@ def strip_libraries(self, arch):

logger.info('Stripping libraries in private dir')
for filen in filens.split('\n'):
if not filen:
continue # skip the last ''
try:
strip(filen, _env=env)
except sh.ErrorReturnCode_1:
Expand Down

0 comments on commit 8c1d5c8

Please sign in to comment.