Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove sys.version_info bridges in client.dynamic #436

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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