Skip to content

Commit 2e94dbc

Browse files
committed
Do not use "L" suffixed integers.
They cause SyntaxError on python3 and aren't need on 2.7. See discussion on PR #259. Closes #262.
1 parent 177aa55 commit 2e94dbc

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

comtypes/automation.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,7 @@ def ChangeType(self, typecode):
549549
VARIANT.empty = VARIANT()
550550
VARIANT.missing = v = VARIANT()
551551
v.vt = VT_ERROR
552-
if sys.version_info >= (3, 0):
553-
v._.VT_I4 = 0x80020004
554-
else:
555-
v._.VT_I4 = 0x80020004L
552+
v._.VT_I4 = 0x80020004
556553
del v
557554

558555
_carg_obj = type(byref(c_int()))

comtypes/test/test_variant.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ def test_integers(self):
111111
else:
112112
self.assertEqual(type(v.value), long)
113113

114-
if sys.version_info >= (3, 0):
115-
v.value = 1
116-
else:
117-
v.value = 1L
114+
v.value = 1
115+
118116
self.assertEqual(v.value, 1)
119117
self.assertEqual(type(v.value), int)
120118

0 commit comments

Comments
 (0)