Commits

Christian Heimes committed 90a3eee

Make code source compatible to Python versions without hash randomization

  • Participants
  • Parent commits 3b130af

Comments (0)

Files changed (6)

 Changelog
 =========
 
+defusedexpat 0.4
+----------------
+
+*Release date: ??-???-2013*
+
+- Make code source compatible to Python versions without hash randomization
+
 defusedexpat 0.3
 ----------------
 

File Modules27/pyexpat.c

     /* This feature was added upstream in libexpat 2.1.0.  Our expat copy
      * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
      * to indicate that we can still use it. */
+#if PY_VERSION_HEX >= 0x02070300
     XML_SetHashSalt(self->itself,
                     (unsigned long)_Py_HashSecret.prefix);
 #endif
+#endif
     self->intern = intern;
     Py_XINCREF(self->intern);
 #ifdef Py_TPFLAGS_HAVE_GC

File Modules31/pyexpat.c

     else {
         self->itself = XML_ParserCreate(encoding);
     }
+#if PY_VERSION_HEX >= 0x03010500
     XML_SetHashSalt(self->itself,
                     (unsigned long)_Py_HashSecret.prefix);
+#endif
     self->intern = intern;
     Py_XINCREF(self->intern);
 #ifdef Py_TPFLAGS_HAVE_GC

File Modules32/pyexpat.c

     /* This feature was added upstream in libexpat 2.1.0.  Our expat copy
      * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
      * to indicate that we can still use it. */
+#if PY_VERSION_HEX >= 0x03020300
     XML_SetHashSalt(self->itself,
                     (unsigned long)_Py_HashSecret.prefix);
 #endif
+#endif
     self->intern = intern;
     Py_XINCREF(self->intern);
     PyObject_GC_Track(self);
 Requirements
 ============
 
-* Python 2.6.6 or newer (2.6.8 for randomized hashing)
-* Python 2.7.3 or newer
-* Python 3.1.5 or newer
-* Python 3.2.3 or newer
+* Python 2.6.6 or newer (2.6.8 or newer for randomized hashing)
+* Python 2.7 (2.7.3 or newer for randomized hashing and Windows binaries)
+* Python 3.1 (3.1.5 or newer for randomized hashing and Windows binaries)
+* Python 3.2 (3.2.3 or newer for randomized hashing and Windows binaries)
 * Python 3.3.0 or newer
 
-
-TODO
-====
-
-* Add functions to get and set default parser values
+Windows binaries are compatible to 2.6.6, 2.7.3, 3.1.5, 3.2.3 or 3.3.0 or
+newer micro releases. They don't work on older versions.
 
 
 License
 
 setup(
     name="defusedexpat",
-    version="0.3",
+    version="0.4dev",
     ext_modules=exts,
     py_modules=["defusedexpat"],
     cmdclass={"test": TestCommand},