Skip to content
Snippets Groups Projects
Commit d70667c5 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Fixed python except statements

`except:` might catch the wrong exception by mistake
parent 663f0a3c
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ import array
try:
import numpy as np
HAS_NUMPY=True
except:
except ImportError:
HAS_NUMPY=False
cdef class Plumed:
......
......@@ -79,7 +79,7 @@ def readme():
try:
include_dirs=[os.environ["plumed_include_dir"]]
except:
except KeyError:
include_dirs=["."]
# allow one to force using cython with env var plumed_force_cython=yes
......@@ -88,7 +88,7 @@ try:
if(os.environ["plumed_force_cython"]=="yes"):
print('plumed_force_cython=yes')
USE_CYTHON = True
except:
except KeyError:
pass
# if plumed.cpp is available, do not need cython
......@@ -103,7 +103,7 @@ if USE_CYTHON:
print('importing cython')
from Cython.Build import cythonize
extension="pyx"
except:
except ImportError:
print('Error: building ' + plumedname + ' requires cython. Please install it first with pip install cython')
sys.exit(-1)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment