[Numpy-svn] r6291 - trunk/numpy/core/code_generators

numpy-svn@scip... numpy-svn@scip...
Sun Jan 4 04:57:45 CST 2009


Author: cdavid
Date: 2009-01-04 04:57:39 -0600 (Sun, 04 Jan 2009)
New Revision: 6291

Modified:
   trunk/numpy/core/code_generators/genapi.py
Log:
Do not import md5 on python >= 2.6; use hashlib instead.

Modified: trunk/numpy/core/code_generators/genapi.py
===================================================================
--- trunk/numpy/core/code_generators/genapi.py	2009-01-01 09:28:16 UTC (rev 6290)
+++ trunk/numpy/core/code_generators/genapi.py	2009-01-04 10:57:39 UTC (rev 6291)
@@ -6,9 +6,15 @@
 specified.
 """
 import sys, os, re
-import md5
 import textwrap
 
+_PY_MAJ, _PY_MIN = sys.version_info[:2]
+# md5 is deprecated from python 2.6
+if _PY_MAJ == 2 and _PY_MIN  < 6:
+    import md5
+else:
+    from hashlib import md5
+
 __docformat__ = 'restructuredtext'
 
 # The files under src/ that are scanned for API functions



More information about the Numpy-svn mailing list