Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b32d95

Browse files
Allow inline comments in VERSIONS file (#19)
1 parent 7d514cd commit 9b32d95

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

tests/typeshed/VERSIONS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
top_level_assert: 2.7
1+
# comment on a line by itself
2+
3+
top_level_assert: 2.7 # inline comment: 3.6
24
lib: 2.7
35
conditions: 2.7
46
new37: 3.7

typeshed_client/finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ def get_typeshed_versions(typeshed: Path) -> Dict[str, _VersionData]:
261261
python2_files = set()
262262
with (typeshed / "VERSIONS").open() as f:
263263
for line in f:
264-
line = line.strip()
265-
if not line or line.startswith("#"):
264+
line = line.split("#")[0].strip()
265+
if not line:
266266
continue
267267
module, version = line.split(": ")
268268
if "-" in version:

0 commit comments

Comments
 (0)