extensions: use sysstr to check for attribute presence
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 30 Aug 2023 13:02:43 +0200
changeset 50894 f75fd677cc05
parent 50893 0e936b950731
child 50895 a834ec41f17c
extensions: use sysstr to check for attribute presence We do not need bytes here.
mercurial/extensions.py
--- a/mercurial/extensions.py	Wed Aug 30 13:00:14 2023 +0200
+++ b/mercurial/extensions.py	Wed Aug 30 13:02:43 2023 +0200
@@ -986,13 +986,13 @@
 
 def moduleversion(module):
     '''return version information from given module as a string'''
-    if util.safehasattr(module, b'getversion') and callable(module.getversion):
+    if util.safehasattr(module, 'getversion') and callable(module.getversion):
         try:
             version = module.getversion()
         except Exception:
             version = b'unknown'
 
-    elif util.safehasattr(module, b'__version__'):
+    elif util.safehasattr(module, '__version__'):
         version = module.__version__
     else:
         version = b''