diff --git a/js2py/constructors/jsarraybuffer.py b/js2py/constructors/jsarraybuffer.py index 6da71aab..d8d1a67e 100644 --- a/js2py/constructors/jsarraybuffer.py +++ b/js2py/constructors/jsarraybuffer.py @@ -5,7 +5,7 @@ from ..base import * try: import numpy -except: +except ImportError: pass diff --git a/js2py/constructors/jsfloat32array.py b/js2py/constructors/jsfloat32array.py index 3a121916..5723d161 100644 --- a/js2py/constructors/jsfloat32array.py +++ b/js2py/constructors/jsfloat32array.py @@ -3,7 +3,7 @@ from ..base import * try: import numpy -except: +except ImportError: pass diff --git a/js2py/constructors/jsint8array.py b/js2py/constructors/jsint8array.py index 3396afea..7a2c40a2 100644 --- a/js2py/constructors/jsint8array.py +++ b/js2py/constructors/jsint8array.py @@ -3,7 +3,7 @@ from ..base import * try: import numpy -except: +except ImportError: pass diff --git a/js2py/constructors/jsuint8array.py b/js2py/constructors/jsuint8array.py index 4b2199da..2ada6b6d 100644 --- a/js2py/constructors/jsuint8array.py +++ b/js2py/constructors/jsuint8array.py @@ -3,7 +3,7 @@ from ..base import * try: import numpy -except: +except ImportError: pass diff --git a/js2py/translators/translator.py b/js2py/translators/translator.py index 5ec47002..5252cab0 100644 --- a/js2py/translators/translator.py +++ b/js2py/translators/translator.py @@ -142,7 +142,7 @@ def translate_js_with_compilation_plan(js, HEADER=DEFAULT_HEADER): cp_hash = hashlib.md5(compilation_plan.encode('utf-8')).digest() try: python_code = cache[cp_hash]['proto_python_code'] - except: + except KeyError: parser = pyjsparser.PyJsParser() parsed = parser.parse(compilation_plan) # js to esprima syntax tree # Another way of doing that would be with my auto esprima translation but its much slower and causes import problems: