We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0efb8f5 commit e2f76f7Copy full SHA for e2f76f7
1 file changed
netpyne_ui/mod_utils.py
@@ -28,17 +28,22 @@ def is_loaded_mechanisms():
28
29
def loadModMechFiles(compileMod, modFolder):
30
# Create Symbolic link
31
- if compileMod:
32
- modPath = os.path.join(str(modFolder), "x86_64")
33
-
34
- if os.path.exists(modPath):
35
- shutil.rmtree(modPath)
36
37
- os.chdir(modFolder)
38
- subprocess.call(["nrnivmodl"])
39
- os.chdir('..')
40
41
- try:
42
- neuron.load_mechanisms(str(modFolder))
43
- except:
44
- raise
+ if compileMod:
+ try:
+ owd = os.getcwd()
+ modPath = os.path.join(str(modFolder), "x86_64")
+
+ if os.path.exists(modPath):
+ shutil.rmtree(modPath)
+ os.chdir(modFolder)
+ subprocess.call(["nrnivmodl"])
+ os.chdir('..')
45
+ neuron.load_mechanisms(str(modFolder))
46
+ except:
47
+ raise
48
+ finally:
49
+ os.chdir(owd)
0 commit comments