@@ -428,8 +428,7 @@ def remove( # type: ignore[override]
428428 cursor = index .cursor (txn = txn )
429429 try :
430430 cursor .set_range (key )
431- # Hack to stop 2to3 converting this to next(cursor)
432- current = getattr (cursor , "next" )()
431+ current = cursor .next
433432 except db .DBNotFoundError :
434433 current = None
435434 cursor .close ()
@@ -506,8 +505,7 @@ def triples(
506505 cursor = index .cursor (txn = txn )
507506 try :
508507 cursor .set_range (key )
509- # Cheap hack so 2to3 doesn't convert to next(cursor)
510- current = getattr (cursor , "next" )()
508+ current = cursor .next
511509 except db .DBNotFoundError :
512510 current = None
513511 cursor .close ()
@@ -539,8 +537,7 @@ def __len__(self, context: Optional[_ContextType] = None) -> int:
539537 key , value = current
540538 if key .startswith (prefix ):
541539 count += 1
542- # Hack to stop 2to3 converting this to next(cursor)
543- current = getattr (cursor , "next" )()
540+ current = cursor .next
544541 else :
545542 break
546543 cursor .close ()
@@ -593,8 +590,7 @@ def namespaces(self) -> Generator[Tuple[str, URIRef], None, None]:
593590 while current :
594591 prefix , namespace = current
595592 results .append ((prefix .decode ("utf-8" ), namespace .decode ("utf-8" )))
596- # Hack to stop 2to3 converting this to next(cursor)
597- current = getattr (cursor , "next" )()
593+ current = cursor .next
598594 cursor .close ()
599595 for prefix , namespace in results :
600596 yield prefix , URIRef (namespace )
@@ -637,8 +633,7 @@ def contexts(
637633 cursor = index .cursor ()
638634 try :
639635 cursor .set_range (key )
640- # Hack to stop 2to3 converting this to next(cursor)
641- current = getattr (cursor , "next" )()
636+ current = cursor .next
642637 except db .DBNotFoundError :
643638 current = None
644639 cursor .close ()
0 commit comments