Skip to content

Commit

Permalink
pl_gen_fused: fix E713
Browse files Browse the repository at this point in the history
Fix "E713 test for membership should be 'not in'"
  • Loading branch information
pjaitken committed Feb 23, 2021
1 parent bc0f079 commit 7840831
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/pl_gen_fused
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class NodeDecl:
def get_next_node(self, disp):
"""Returns the next node name corresponding to the given disposition"""
next_node_name = self.next_nodes[disp]
if not ':' in next_node_name:
if ':' not in next_node_name:
return self.domain + ':' + next_node_name
return next_node_name

Expand Down Expand Up @@ -183,21 +183,21 @@ class FeatureDecl:
@property
def node_name(self):
node_name = self.__node_name
if not ':' in node_name:
if ':' not in node_name:
return self.domain + ':' + node_name
return node_name

@property
def feature_point(self):
feature_point = self.__feature_point
if not ':' in feature_point:
if ':' not in feature_point:
return self.domain + ':' + feature_point
return feature_point

@property
def visit_after(self):
visit_after = self.__visit_after
if visit_after is not None and not ':' in visit_after:
if visit_after is not None and ':' not in visit_after:
return self.domain + ':' + visit_after
return visit_after

Expand Down Expand Up @@ -281,7 +281,7 @@ def parse_source_file(filename):
parsing_feature_decl.visit_after,
parsing_feature_decl.feat_type))
parsing_feature_decl.validate()
if not parsing_feature_decl.feature_point in feats_for_feat_point:
if parsing_feature_decl.feature_point not in feats_for_feat_point:
feats_for_feat_point[parsing_feature_decl.feature_point] = {}
feats_for_feat_point[parsing_feature_decl.feature_point][parsing_feature_decl.name] = parsing_feature_decl
parsing_feature_decl = None
Expand Down Expand Up @@ -433,7 +433,7 @@ def gen_invoke_fused_node(f, indent_lvl, from_feature_point, dyn_feats, from_cas

def gen_fused_graph(f, entry, dyn_feats):
"""Generate fused mode graph starting from the given entry point"""
if not entry in nodes:
if entry not in nodes:
raise RuntimeError('Unknown entry-point node: {}'.format(entry))
node = nodes[entry]
write_indent(f, 0, 'ALWAYS_INLINE bool')
Expand Down Expand Up @@ -554,7 +554,7 @@ def gen_fused_features_invoke(f, feat_point, dyn_feats):
The features are listed in the order they get added to the feature
point array
"""
if not feat_point in nodes:
if feat_point not in nodes:
raise RuntimeError('Unknown feature point node: {}'.format(feat_point))
node = nodes[feat_point]

Expand Down Expand Up @@ -583,14 +583,14 @@ def gen_fused_features_invoke(f, feat_point, dyn_feats):
resp_written = False
head_features = dict(features)
for feature in features.values():
if not feature.node_name in nodes:
if feature.node_name not in nodes:
raise RuntimeError(
"unknown node {} for feature {}".format(feature.node_name, feature.name))
if len(nodes[feature.node_name].next_nodes) > 1 and not resp_written:
write_indent(f, 1, 'int resp;')
resp_written = True
if feature.visit_after:
if not feature.visit_after in features:
if feature.visit_after not in features:
raise RuntimeError(
"unknown visit after {} for feature {}".format(feature.visit_after, feature.name))
# We only support one feature referencing another feature
Expand Down Expand Up @@ -769,7 +769,7 @@ def gen_fused_header(f, c_file_name, entry_points, feat_points):
write_indent(f, 0, '/* Fused-mode graph entry points */')
if entry_points is not None:
for entry in entry_points:
if not entry in nodes:
if entry not in nodes:
raise RuntimeError(
'Unknown entry-point node: {}'.format(entry))
node = nodes[entry]
Expand All @@ -779,7 +779,7 @@ def gen_fused_header(f, c_file_name, entry_points, feat_points):
write_indent(f, 0, '/* Fused-mode feature invocations */')
if feat_points is not None:
for feat_point in feat_points:
if not feat_point in nodes:
if feat_point not in nodes:
raise RuntimeError(
'Unknown feature point node: {}'.format(feat_point))
node = nodes[feat_point]
Expand Down

0 comments on commit 7840831

Please sign in to comment.