diff options
author | Daniel Wozniak <dan@woz.io> | 2018-09-12 10:38:35 -0600 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2018-10-02 13:35:00 +0200 |
commit | b3ec969cb33b0e266b95bb22acf0ce813701e8cb (patch) | |
tree | 4dadeb5f55f1f659f27eccfe78683f175f89731c | |
parent | bff6b53c801a69910c6374e1c48fa96502a6c08c (diff) | |
download | m2crypto-b3ec969cb33b0e266b95bb22acf0ce813701e8cb.tar.gz |
Fix py2 tests
-rw-r--r-- | SWIG/_asn1.i | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/SWIG/_asn1.i b/SWIG/_asn1.i index 0c7ee6d..a4c7e8e 100644 --- a/SWIG/_asn1.i +++ b/SWIG/_asn1.i @@ -148,12 +148,10 @@ int asn1_integer_set(ASN1_INTEGER *asn1, PyObject *value) { * PyLong_AsLong shims as provided in * /usr/include/python2.7/longobject.h. */ - if (PyLong_Check(value)) { - int overflow = 0; - long val = PyLong_AsLongAndOverflow(value, &overflow); - if (overflow == 0) - return ASN1_INTEGER_set(asn1, val); - } + int overflow = 0; + long val = PyLong_AsLongAndOverflow(value, &overflow); + if (overflow == 0) + return ASN1_INTEGER_set(asn1, val); if (!PyLong_Check(value)){ PyErr_SetString(PyExc_TypeError, "expected int or long"); |