Skip to content

Commit

Permalink
Replace deprecated threading.currentThread (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman authored Sep 20, 2024
1 parent 64b0364 commit ceeaff8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocs/ocs_twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ def in_reactor_context():
it's the main thread. Will raise RuntimeError if the thread name
is confusing.
"""
t = threading.currentThread()
t = threading.current_thread()
if 'PoolThread' in t.name:
return False
if 'MainThread' in t.name:
return True
raise RuntimeError('Could not determine threading context: '
'currentThread.name="%s"' % t.name)
'current_thread.name="%s"' % t.name)


class Pacemaker:
Expand Down

0 comments on commit ceeaff8

Please sign in to comment.