Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 51727:92845af308b4
typing: narrow the scope of some recent disabled import warnings
These comments were added in 39e2b2d062c1, but had the effect of changing the
known type to `Any`, which cascaded through a few function signatures. Just
ignore the import error instead.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 24 Jul 2024 18:17:00 -0400 |
parents | 278af66e6595 |
children | b619ba39d10a |
comparison
equal
deleted
inserted
replaced
51725:278af66e6595 | 51727:92845af308b4 |
---|---|
1160 | 1160 |
1161 | 1161 |
1162 def version(): | 1162 def version(): |
1163 """Return version information if available.""" | 1163 """Return version information if available.""" |
1164 try: | 1164 try: |
1165 from . import __version__ # type: ignore | 1165 from . import __version__ # pytype: disable=import-error |
1166 | 1166 |
1167 return __version__.version | 1167 return __version__.version |
1168 except ImportError: | 1168 except ImportError: |
1169 return b'unknown' | 1169 return b'unknown' |
1170 | 1170 |