diff hgext/lfs/blobstore.py @ 50925:d718eddf01d9

safehasattr: drop usage in favor of hasattr The two functions should now be equivalent at least in their usage in core.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 31 Aug 2023 23:56:15 +0200
parents 6543469a351e
children 18c8c18993f0
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py	Thu Dec 08 15:33:19 2022 +0100
+++ b/hgext/lfs/blobstore.py	Thu Aug 31 23:56:15 2023 +0200
@@ -271,7 +271,7 @@
     if isinstance(urlerror.reason, Exception):
         inst = urlerror.reason
 
-    if util.safehasattr(inst, 'reason'):
+    if hasattr(inst, 'reason'):
         try:  # usually it is in the form (errno, strerror)
             reason = inst.reason.args[1]
         except (AttributeError, IndexError):
@@ -751,7 +751,7 @@
     if lfsurl is None:
         if remote:
             path = remote
-        elif util.safehasattr(repo, '_subtoppath'):
+        elif hasattr(repo, '_subtoppath'):
             # The pull command sets this during the optional update phase, which
             # tells exactly where the pull originated, whether 'paths.default'
             # or explicit.