Patchwork [2,of,2] util: define PyInt_Type on Python 3

login
register
mail settings
Submitter Gregory Szorc
Date Oct. 8, 2016, 5:09 p.m.
Message ID <266ad9c9faa524a8b3f4.1475946558@gps-mbp.local>
Download mbox | patch
Permalink /patch/16956/
State Accepted
Headers show

Comments

Gregory Szorc - Oct. 8, 2016, 5:09 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1475946164 -7200
#      Sat Oct 08 19:02:44 2016 +0200
# Node ID 266ad9c9faa524a8b3f473c924db409681cb205e
# Parent  66c3f600e684f2323ac56c16eba6a57930f8919e
util: define PyInt_Type on Python 3

util.h attempts to wallpaper over C API differences between Python 2
and 3. This is not the correct approach where performance is critical.
But it is good enough for the current state of the Python 3 port.

Patch

diff --git a/mercurial/util.h b/mercurial/util.h
--- a/mercurial/util.h
+++ b/mercurial/util.h
@@ -12,8 +12,9 @@ 
 
 #if PY_MAJOR_VERSION >= 3
 
 #define IS_PY3K
+#define PyInt_Type PyLong_Type
 #define PyInt_FromLong PyLong_FromLong
 #define PyInt_AsLong PyLong_AsLong
 
 /*