diff --git a/src/Mod/Arch/importIFCmulticore.py b/src/Mod/Arch/importIFCmulticore.py index fc8427f74f..40ab998c2c 100644 --- a/src/Mod/Arch/importIFCmulticore.py +++ b/src/Mod/Arch/importIFCmulticore.py @@ -106,17 +106,13 @@ def insert(filename,docname=None,preferences=None): count = 0 # process objects - while True: - item = iterator.get() - if item: - brep = item.geometry.brep_data - ifcproduct = ifcfile.by_id(item.guid) - obj = createProduct(ifcproduct,brep) - progressbar.next(True) - writeProgress(count,productscount,starttime) - count += 1 - if not iterator.next(): - break + for item in iterator: + brep = item.geometry.brep_data + ifcproduct = ifcfile.by_id(item.guid) + obj = createProduct(ifcproduct,brep) + progressbar.next(True) + writeProgress(count,productscount,starttime) + count += 1 # process 2D annotations annotations = ifcfile.by_type("IfcAnnotation") diff --git a/src/Mod/Fem/femsolver/elmer/sifio.py b/src/Mod/Fem/femsolver/elmer/sifio.py index 0980390010..8ded82eb04 100644 --- a/src/Mod/Fem/femsolver/elmer/sifio.py +++ b/src/Mod/Fem/femsolver/elmer/sifio.py @@ -334,7 +334,7 @@ class _Writer(object): def _getOnlyElement(self, collection): it = iter(collection) - return it.next() + return next(it) def _isCollection(self, data): return (