* python/py-arch.c (archpy_disassemble): Use PyInt_Check and
authorTom Tromey <tromey@redhat.com>
Thu, 28 Feb 2013 20:14:08 +0000 (20:14 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 28 Feb 2013 20:14:08 +0000 (20:14 +0000)
PyLong_Check.

gdb/ChangeLog
gdb/python/py-arch.c

index d92a7037397efdbb74e1001de277eecd22f6d882..c788b3ba41bd6eea29d3ca225cc8d2508b039de9 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-28  Tom Tromey  <tromey@redhat.com>
+
+       * python/py-arch.c (archpy_disassemble): Use PyInt_Check and
+       PyLong_Check.
+
 2013-02-28  Doug Evans  <dje@google.com>
 
        * python/py-finishbreakpoint.c (bpfinishpy_init): gcc -Wall lint.
index b41de0625227de0ffa131f43ce8ba38a6c810e67..ddfebdb2f7dd9ef92bd588c46bb27eb59c88f6b6 100644 (file)
@@ -111,12 +111,12 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
   start = start_temp;
   if (end_obj)
     {
-      if (PyObject_TypeCheck (end_obj, &PyInt_Type))
+      if (PyLong_Check (end_obj))
+        end = PyLong_AsUnsignedLongLong (end_obj);
+      else if (PyInt_Check (end_obj))
         /* If the end_pc value is specified without a trailing 'L', end_obj will
            be an integer and not a long integer.  */
         end = PyInt_AsLong (end_obj);
-      else if (PyObject_TypeCheck (end_obj, &PyLong_Type))
-        end = PyLong_AsUnsignedLongLong (end_obj);
       else
         {
           Py_DECREF (end_obj);