aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib_pypy')
-rw-r--r--lib_pypy/_tkinter/tclobj.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib_pypy/_tkinter/tclobj.py b/lib_pypy/_tkinter/tclobj.py
index 26182214de..3a5c599111 100644
--- a/lib_pypy/_tkinter/tclobj.py
+++ b/lib_pypy/_tkinter/tclobj.py
@@ -142,7 +142,16 @@ def AsObj(value):
if isinstance(value, bool):
return tklib.Tcl_NewBooleanObj(value)
if isinstance(value, int):
- return tklib.Tcl_NewLongObj(value)
+ try:
+ return tklib.Tcl_NewLongObj(value)
+ except OverflowError:
+ # 64-bit windows
+ if tklib.HAVE_WIDE_INT_TYPE:
+ return tklib.Tcl_NewWideIntObj(value)
+ else:
+ import sys
+ t, v, tb = sys.exc_info()
+ raise t, v, tb
if isinstance(value, long):
try:
tkffi.new("long[]", [value])