Skip to content

Commit 900d032

Browse files
Another fix for Issue #15.
-2.7 build was failing due to int/long differences between 2/3. Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent ca16e49 commit 900d032

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/methods.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ PyObject* meth_find_devices(PyObject* self, PyObject* args, PyObject* keywords)
177177
int count = 255;
178178
unsigned long legacy_dev_type = 0xFFFFBFFF;
179179
bool use_legacy_device_type = false;
180+
#if PY_MAJOR_VERSION >= 3
180181
if (device_type && PyLong_Check(device_type))
182+
#else
183+
if (device_type && PyInt_Check(device_type))
184+
#endif PY_MAJOR_VERSION >= 3
181185
{
182186
legacy_dev_type = PyLong_AsLong(device_type);
183187
use_legacy_device_type = true;

0 commit comments

Comments
 (0)