There is no more PyInt_FromLong in 3.x; PyLong_FromLong works everywhere
diff --git a/OpenSSL/crypto/x509.c b/OpenSSL/crypto/x509.c
index 7026edb..5d03d2e 100644
--- a/OpenSSL/crypto/x509.c
+++ b/OpenSSL/crypto/x509.c
@@ -698,7 +698,7 @@
         return NULL;
     }
 
-    return PyInt_FromLong((long)X509_get_ext_count(self->x509));
+    return PyLong_FromLong((long)X509_get_ext_count(self->x509));
 }
 
 static char crypto_X509_get_extension_doc[] = "\n\