Skip to content

Commit

Permalink
remove sys.version_info bridges (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd authored Dec 31, 2022
1 parent b6a4181 commit 0cadf77
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions comtypes/client/dynamic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import ctypes
import comtypes.automation
import comtypes.typeinfo
Expand Down Expand Up @@ -158,21 +157,11 @@ class _Collection(object):
def __init__(self, enum):
self.enum = enum

if sys.version_info >= (3, 0):

def __next__(self):
item, fetched = self.enum.Next(1)
if fetched:
return item
raise StopIteration

else:

def next(self):
item, fetched = self.enum.Next(1)
if fetched:
return item
raise StopIteration
def __next__(self):
item, fetched = self.enum.Next(1)
if fetched:
return item
raise StopIteration

def __iter__(self):
return self
Expand Down

0 comments on commit 0cadf77

Please sign in to comment.