diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index c971a3dbca0861ec98c366c456b0aca803b1f902_c2ltcGxlanNvbi9fc3BlZWR1cHMuYw==..800c7e64290963286d4c548eacdd6665e52bc6ad_c2ltcGxlanNvbi9fc3BlZWR1cHMuYw== 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -10,6 +10,9 @@
 #define PyInt_FromSsize_t PyInt_FromLong
 #define PyInt_AsSsize_t PyInt_AsLong
 #endif
+#ifndef Py_IS_FINITE
+#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
+#endif
 
 #ifdef __GNUC__
 #define UNUSED __attribute__((__unused__))