We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f3777c commit e424a8dCopy full SHA for e424a8d
cli/__version__.py
@@ -24,10 +24,10 @@ def _discover_package_version() -> str:
24
try:
25
with open(setup_path, "r", encoding="utf-8") as f:
26
content = f.read()
27
- match = re.search(r"version=\"([^\"]+)\"", content)
+ match = re.search(r"version\s*=\s*[\"'](.*?)[\"']", content)
28
if match:
29
return match.group(1)
30
- except Exception:
+ except (OSError, IOError, UnicodeDecodeError):
31
pass
32
33
return "0.0.0"
0 commit comments