Skip to content

Commit

Permalink
Fix use of enum flags in older python/sip versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 2, 2020
1 parent acf7273 commit 579ef1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/AlgorithmDialog.py
Expand Up @@ -210,7 +210,7 @@ def runAlgorithm(self):
self.iterateParam = None

for param in self.algorithm().parameterDefinitions():
if isinstance(parameters.get(param.name(), None), QgsProcessingFeatureSourceDefinition) and parameters[param.name()].flags & QgsProcessingFeatureSourceDefinition.Flag.FlagCreateIndividualOutputPerInputFeature:
if isinstance(parameters.get(param.name(), None), QgsProcessingFeatureSourceDefinition) and parameters[param.name()].flags & QgsProcessingFeatureSourceDefinition.Flag.FlagCreateIndividualOutputPerInputFeature.value:
self.iterateParam = param.name()
break

Expand Down
3 changes: 1 addition & 2 deletions tests/src/python/test_qgsxmlutils.py
Expand Up @@ -261,8 +261,7 @@ def test_feature_source_definition(self):
self.assertEqual(c.source.staticValue(), 'my source')
self.assertTrue(c.selectedFeaturesOnly)
self.assertEqual(c.featureLimit, 27)
# Travis won't allow this -- maybe Python version related?
#self.assertEqual(c.flags, QgsProcessingFeatureSourceDefinition.Flag.FlagCreateIndividualOutputPerInputFeature)
self.assertEqual(c.flags, QgsProcessingFeatureSourceDefinition.Flag.FlagCreateIndividualOutputPerInputFeature.value)
self.assertEqual(c.geometryCheck, QgsFeatureRequest.GeometrySkipInvalid)

def test_output_layer_definition(self):
Expand Down

0 comments on commit 579ef1c

Please sign in to comment.