Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
446aaeb4
Unverified
Commit
446aaeb4
authored
Jan 25, 2022
by
Raimondas Galvelis
Committed by
GitHub
Jan 25, 2022
Browse files
Fix GIL for OpenMM::Context::setVelocitiesToTemperature (#3424)
parent
7d0ec0bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
wrappers/python/src/swig_doxygen/swig_lib/python/exceptions.i
...pers/python/src/swig_doxygen/swig_lib/python/exceptions.i
+14
-0
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/exceptions.i
View file @
446aaeb4
...
@@ -51,3 +51,17 @@
...
@@ -51,3 +51,17 @@
}
}
PyEval_RestoreThread
(
_savePythonThreadState
)
;
PyEval_RestoreThread
(
_savePythonThreadState
)
;
}
}
%
exception
OpenMM
::
Context
::
setVelocitiesToTemperature
{
PyThreadState
*
_savePythonThreadState
=
PyEval_SaveThread
()
;
try
{
$
action
}
catch
(
std
::
exception
&
e)
{
PyEval_RestoreThread
(
_savePythonThreadState
)
;
PyObject
*
mm
=
PyImport_AddModule
(
"openmm"
)
;
PyObject
*
openmm_exception
=
PyObject_GetAttrString
(
mm
,
"OpenMMException"
)
;
PyErr_SetString
(
openmm_exception
,
const_cast
<
char
*>
(
e
.
what
()))
;
return
NULL
;
}
PyEval_RestoreThread
(
_savePythonThreadState
)
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment