Skip to content

Commit

Permalink
Use current_thread instead of currentThread method that was deprecate…
Browse files Browse the repository at this point in the history
…d in Python 3.10. (#662)
  • Loading branch information
tirkarthi authored May 30, 2021
1 parent bc86e6f commit 7351853
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydal/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def get_instances():
def distributed_transaction_begin(*instances):
if not instances:
return
thread_key = "%s.%s" % (socket.gethostname(), threading.currentThread())
thread_key = "%s.%s" % (socket.gethostname(), threading.current_thread())
instances = enumerate(instances)
keys = ["%s.%i" % (thread_key, i) for (i, db) in instances]
for (i, db) in instances:
Expand All @@ -395,7 +395,7 @@ def distributed_transaction_commit(*instances):
if not instances:
return
instances = enumerate(instances)
thread_key = "%s.%s" % (socket.gethostname(), threading.currentThread())
thread_key = "%s.%s" % (socket.gethostname(), threading.current_thread())
keys = ["%s.%i" % (thread_key, i) for (i, db) in instances]
for (i, db) in instances:
if not db._adapter.support_distributed_transaction():
Expand Down

0 comments on commit 7351853

Please sign in to comment.