diff options
author | 2020-08-29 01:21:36 +0200 | |
---|---|---|
committer | 2020-08-29 01:21:36 +0200 | |
commit | 1847ffbf6f4a92eeeb855fbd985afde55b1ccb7e (patch) | |
tree | eccb5f50db9ff8492c993e5610d9b646729621b8 /lib_pypy | |
parent | fix Py_ssize_t on win64 (diff) | |
download | pypy-1847ffbf6f4a92eeeb855fbd985afde55b1ccb7e.tar.gz pypy-1847ffbf6f4a92eeeb855fbd985afde55b1ccb7e.tar.bz2 pypy-1847ffbf6f4a92eeeb855fbd985afde55b1ccb7e.zip |
fix tclobj.AsObj for win64 int type
Diffstat (limited to 'lib_pypy')
-rw-r--r-- | lib_pypy/_tkinter/tclobj.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib_pypy/_tkinter/tclobj.py b/lib_pypy/_tkinter/tclobj.py index f5cff6930d..d5a7b2b301 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]) |