# HG changeset patch # User Karthikeyan Singaravelan # Date 2021-05-14 10:01:29 # Node ID 63286e0886a68ffd603fa33c458ce7febadc90e5 # Parent 5d5abfdc32d8ee4df5832a06a9b44bbf03133b2b vfs: Fix deprecation warning in Python 3.10 (issue6520) Differential Revision: https://phab.mercurial-scm.org/D10710 diff --git a/mercurial/vfs.py b/mercurial/vfs.py --- a/mercurial/vfs.py +++ b/mercurial/vfs.py @@ -307,7 +307,7 @@ class abstractvfs(object): # 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 @@ class vfs(abstractvfs): fp = checkambigatclosing(fp) if backgroundclose and isinstance( - threading.currentThread(), + threading.current_thread(), threading._MainThread, # pytype: disable=module-attr ): if (