Skip to content

Commit

Permalink
Catch errors when trying to change multiprocessing start method
Browse files Browse the repository at this point in the history
- Resolves issues as described in #787 and #782
  • Loading branch information
smathot committed May 22, 2023
1 parent bd2ef76 commit 22c3544
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libqtopensesame/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@
# However, setting the OPENSESAME_MULTIPROCESSING_METHOD environment
# variable allows users to customize this. See also:
# - <https://github.com/open-cogsci/OpenSesame/issues/782>
multiprocessing.set_start_method(
os.environ.get('OPENSESAME_MULTIPROCESSING_METHOD', 'spawn'))
try:
multiprocessing.set_start_method(
os.environ.get('OPENSESAME_MULTIPROCESSING_METHOD', 'spawn'))
except RuntimeError as e:
print(f'failed to change multiprocessing start method: {e}')
except ValueError as e:
print(f'invalid multiprocessing start method: {e}')
# solves a library conflict for Linux with Nvidia drivers
# See https://forum.qt.io/topic/81328/ubuntu-qopenglshaderprogram-shader-program-is-not-linked/2
try:
Expand Down

0 comments on commit 22c3544

Please sign in to comment.