Handle crashes

This commit is contained in:
Oleksii Shevchuk 2017-05-23 12:47:38 +03:00
parent ffaa9615e5
commit 11fe90f7f9
3 changed files with 13 additions and 10 deletions

View File

@ -12,6 +12,11 @@ platform.system = lambda: 'android'
if __name__ == '__main__':
import pp
while True:
print "starting pupy ..."
pp.main()
print "pupy exit"
try:
print "starting pupy ..."
pp.main()
print "pupy exit"
except Exception, e:
print "pupy crashed: ", e
import traceback
traceback.print_exc(e)

View File

@ -610,5 +610,3 @@ def install(debug=None, trace=False):
if sys.platform == 'win32':
import pywintypes
if __debug:
for module in modules.iterkeys():

View File

@ -442,11 +442,6 @@ class PupyClient(object):
pupyimporter = self.conn.modules.pupyimporter
initial_module_name = module_name
if not self.desc.get('native', False):
# If this is not light-weight "client", then try to load native libs frist
if pupyimporter.native_import(module_name):
return True
if not remote and not module_name.endswith(('.dll', '.so')):
if pupyimporter.has_module(module_name):
if not force:
@ -455,6 +450,11 @@ class PupyClient(object):
update = True
pupyimporter.invalidate_module(module_name)
if not self.desc.get('native', False):
# If this is not light-weight "client", then try to load native libs frist
if pupyimporter.native_import(module_name):
return True
start_path=module_name.replace(".", "/")
package_found=False
package_path=None