Patchwork D10710: vfs: Fix deprecation warning in Python 3.10 (issue6520)

login
register
mail settings
Submitter phabricator
Date May 14, 2021, 10:12 a.m.
Message ID <differential-rev-PHID-DREV-krdwnyy3cduymhmynv46-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49030/
State Superseded
Headers show

Comments

phabricator - May 14, 2021, 10:12 a.m.
tir.karthi created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  fix-threading

REVISION DETAIL
  https://phab.mercurial-scm.org/D10710

AFFECTED FILES
  mercurial/vfs.py

CHANGE DETAILS




To: tir.karthi, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -307,7 +307,7 @@ 
         # multiple instances puts us at risk of running out of file descriptors
         # only allow to use backgroundfilecloser when in main thread.
         if not isinstance(
-            threading.currentThread(),
+            threading.current_thread(),
             threading._MainThread,  # pytype: disable=module-attr
         ):
             yield
@@ -483,7 +483,7 @@ 
             fp = checkambigatclosing(fp)
 
         if backgroundclose and isinstance(
-            threading.currentThread(),
+            threading.current_thread(),
             threading._MainThread,  # pytype: disable=module-attr
         ):
             if (