From patchwork Fri May 14 10:12:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10710: vfs: Fix deprecation warning in Python 3.10 (issue6520) From: phabricator X-Patchwork-Id: 49030 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 14 May 2021 10:12:05 +0000 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 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 (