Skip to content

Commit b7fe2c5

Browse files
committed
Fix bugs in featureck.py
1 parent 9758c48 commit b7fe2c5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/etc/featureck.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,17 @@
9797
if not m is None:
9898
feature_name = m.group(2)
9999
since = None
100-
if "stable" in line:
100+
if re.compile("\[ *stable").search(line) is not None:
101101
pp = re.compile('since *= *"([\w\.]*)"')
102102
mm = pp.search(line)
103-
since = m.group(1)
103+
if not mm is None:
104+
since = mm.group(1)
105+
else:
106+
print "error: misformed stability attribute"
107+
print "line " + str(line_num) + " of " + path + ":"
108+
print line
109+
errors = True
110+
104111
lib_features[feature_name] = feature_name
105112
if lib_features_and_level.get((feature_name, level)) is None:
106113
# Add it to the observed features
@@ -172,7 +179,6 @@
172179
stable_since = lib_features_and_level[(name, "stable")][0]
173180
elif is_unstable:
174181
status = "unstable"
175-
stable_since = lib_features_and_level[(name, "unstable")][0]
176182

177183
lib_feature_stats[name] = (name, lang, lib, status, stable_since)
178184

@@ -220,7 +226,6 @@
220226
type_ = "lang/lib"
221227
elif s[2]:
222228
type_ = "lib"
223-
line = s[0] + ",\t\t\t" + type_ + ",\t" + s[3] + ",\t" + str(s[4])
224229
line = "{: <32}".format(s[0]) + \
225230
"{: <8}".format(type_) + \
226231
"{: <12}".format(s[3]) + \

0 commit comments

Comments
 (0)