فهرست منبع

HPCC-12912 - Some examples in regression suite fail on python 2.6

Minor change following review.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 سال پیش
والد
کامیت
79695b92c6
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      plugins/pyembed/pyembed.cpp

+ 2 - 2
plugins/pyembed/pyembed.cpp

@@ -80,7 +80,7 @@ public:
     inline operator PyObject *() const    { return ptr; }
     inline void clear()                     { if (ptr) Py_DECREF(ptr); ptr = NULL; }
     inline void setown(PyObject *_ptr)      { clear(); ptr = _ptr; }
-    inline void set(PyObject *_ptr)         { clear(); ptr = _ptr; if (ptr) Py_INCREF(ptr);}
+    inline void set(PyObject *_ptr)         { if (_ptr) Py_INCREF(_ptr); clear(); ptr = _ptr; }
     inline PyObject *getLink()              { if (ptr) Py_INCREF(ptr); return ptr;}
     inline PyObject **ref()                 { return &ptr; }
 };
@@ -99,7 +99,7 @@ public:
     inline operator X *() const      { return ptr; }
     inline void clear()              { if (ptr) Py_DECREF(ptr); ptr = NULL; }
     inline void setown(X *_ptr)      { clear(); ptr = _ptr; }
-    inline void set(X *_ptr)         { clear(); ptr = _ptr; if (ptr) Py_INCREF(ptr);}
+    inline void set(X *_ptr)         { if (_ptr) Py_INCREF(_ptr); clear(); ptr = _ptr; }
     inline X *getLink()              { if (ptr) Py_INCREF(ptr); return ptr;}
     inline X **ref()                 { return &ptr; }
 };