File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
======
3
3
4
4
* #296: Exclude 'prepare' package.
5
+ * #297: Fix ValueError when entry points contains comments.
5
6
6
7
v3.9.0
7
8
======
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ class Sectioned:
82
82
_sample = textwrap .dedent (
83
83
"""
84
84
[sec1]
85
+ # comments ignored
85
86
a = 1
86
87
b = 2
87
88
@@ -102,13 +103,17 @@ def __call__(self, line):
102
103
103
104
@classmethod
104
105
def get_sections (cls , text ):
105
- lines = filter (None , map (str .strip , text .splitlines ()))
106
+ lines = filter (cls . valid , map (str .strip , text .splitlines ()))
106
107
return (
107
108
(section , map (cls .parse_value , values ))
108
109
for section , values in itertools .groupby (lines , cls ())
109
110
if section is not None
110
111
)
111
112
113
+ @staticmethod
114
+ def valid (line ):
115
+ return line and not line .startswith ('#' )
116
+
112
117
@staticmethod
113
118
def parse_value (line ):
114
119
return map (str .strip , line .split ("=" , 1 ))
You can’t perform that action at this time.
0 commit comments