File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 22======
33
44* #296: Exclude 'prepare' package.
5+ * #297: Fix ValueError when entry points contains comments.
56
67v3.9.0
78======
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ class Sectioned:
8282 _sample = textwrap .dedent (
8383 """
8484 [sec1]
85+ # comments ignored
8586 a = 1
8687 b = 2
8788
@@ -102,13 +103,17 @@ def __call__(self, line):
102103
103104 @classmethod
104105 def get_sections (cls , text ):
105- lines = filter (None , map (str .strip , text .splitlines ()))
106+ lines = filter (cls . valid , map (str .strip , text .splitlines ()))
106107 return (
107108 (section , map (cls .parse_value , values ))
108109 for section , values in itertools .groupby (lines , cls ())
109110 if section is not None
110111 )
111112
113+ @staticmethod
114+ def valid (line ):
115+ return line and not line .startswith ('#' )
116+
112117 @staticmethod
113118 def parse_value (line ):
114119 return map (str .strip , line .split ("=" , 1 ))
You can’t perform that action at this time.
0 commit comments