Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 51698:b0a4de6c14f8
pytype: work around wrong ImportError flagging
As documented in https://github.com/google/pytype/issues/163, newer versions
of Pytype do not understand caught `ImportError`, so we temporarily ignore
them where applicable.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 18 Jul 2024 12:03:29 +0200 |
parents | 7f0cb9ee0534 |
children | ca7bde5dbafb |
comparison
equal
deleted
inserted
replaced
51697:97d013f48cae | 51698:b0a4de6c14f8 |
---|---|
1150 | 1150 |
1151 | 1151 |
1152 def version(): | 1152 def version(): |
1153 """Return version information if available.""" | 1153 """Return version information if available.""" |
1154 try: | 1154 try: |
1155 from . import __version__ | 1155 from . import __version__ # type: ignore |
1156 | 1156 |
1157 return __version__.version | 1157 return __version__.version |
1158 except ImportError: | 1158 except ImportError: |
1159 return b'unknown' | 1159 return b'unknown' |
1160 | 1160 |