Skip to content

Commit 0d5a1df

Browse files
authored
Allow inline comments in VERSIONS (#10472)
1 parent 5a105d1 commit 0d5a1df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/modulefinder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,8 @@ def load_stdlib_py_versions(custom_typeshed_dir: Optional[str]
761761
assert os.path.isfile(versions_path), (custom_typeshed_dir, versions_path, __file__)
762762
with open(versions_path) as f:
763763
for line in f:
764-
line = line.strip()
765-
if line.startswith("#") or line == "":
764+
line = line.split("#")[0].strip()
765+
if line == "":
766766
continue
767767
module, version_range = line.split(":")
768768
versions = version_range.split("-")

0 commit comments

Comments
 (0)