diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -930,7 +930,11 @@ def moduleversion(module): '''return version information from given module as a string''' if util.safehasattr(module, b'getversion') and callable(module.getversion): - version = module.getversion() + try: + version = module.getversion() + except Exception: + version = b'unknown' + elif util.safehasattr(module, b'__version__'): version = module.__version__ else: