@@ -428,8 +428,7 @@ def remove( # type: ignore[override]
428
428
cursor = index .cursor (txn = txn )
429
429
try :
430
430
cursor .set_range (key )
431
- # Hack to stop 2to3 converting this to next(cursor)
432
- current = getattr (cursor , "next" )()
431
+ current = cursor .next
433
432
except db .DBNotFoundError :
434
433
current = None
435
434
cursor .close ()
@@ -506,8 +505,7 @@ def triples(
506
505
cursor = index .cursor (txn = txn )
507
506
try :
508
507
cursor .set_range (key )
509
- # Cheap hack so 2to3 doesn't convert to next(cursor)
510
- current = getattr (cursor , "next" )()
508
+ current = cursor .next
511
509
except db .DBNotFoundError :
512
510
current = None
513
511
cursor .close ()
@@ -539,8 +537,7 @@ def __len__(self, context: Optional[_ContextType] = None) -> int:
539
537
key , value = current
540
538
if key .startswith (prefix ):
541
539
count += 1
542
- # Hack to stop 2to3 converting this to next(cursor)
543
- current = getattr (cursor , "next" )()
540
+ current = cursor .next
544
541
else :
545
542
break
546
543
cursor .close ()
@@ -593,8 +590,7 @@ def namespaces(self) -> Generator[Tuple[str, URIRef], None, None]:
593
590
while current :
594
591
prefix , namespace = current
595
592
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
598
594
cursor .close ()
599
595
for prefix , namespace in results :
600
596
yield prefix , URIRef (namespace )
@@ -637,8 +633,7 @@ def contexts(
637
633
cursor = index .cursor ()
638
634
try :
639
635
cursor .set_range (key )
640
- # Hack to stop 2to3 converting this to next(cursor)
641
- current = getattr (cursor , "next" )()
636
+ current = cursor .next
642
637
except db .DBNotFoundError :
643
638
current = None
644
639
cursor .close ()
0 commit comments