diff mercurial/utils/compression.py @ 50951: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 93b0de7f13ca
children 18c8c18993f0
line wrap: on
line diff
--- a/mercurial/utils/compression.py	Thu Dec 08 15:33:19 2022 +0100
+++ b/mercurial/utils/compression.py	Thu Aug 31 23:56:15 2023 +0200
@@ -16,8 +16,6 @@
 )
 from . import stringutil
 
-safehasattr = pycompat.safehasattr
-
 
 _ = i18n._
 
@@ -340,7 +338,7 @@
 
 class _CompressedStreamReader:
     def __init__(self, fh):
-        if safehasattr(fh, 'unbufferedread'):
+        if hasattr(fh, 'unbufferedread'):
             self._reader = fh.unbufferedread
         else:
             self._reader = fh.read