Replaced python2 usage of next()
iterator.next() is deprecated in python3. next(iterator) is the direct replacement. In some cases a for() loop makes more sense
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user