[Python-checkins] distutils2: Silence two py3k deprecation warnings and fix a bug.

tarek.ziade python-checkins at python.org
Wed Jun 2 01:18:23 CEST 2010


tarek.ziade pushed ce0d6be25d09 to distutils2:

http://hg.python.org/distutils2/rev/ce0d6be25d09
changeset:   191:ce0d6be25d09
user:        ?ric Araujo <merwok at netwok.org>
date:        Mon May 31 23:03:46 2010 +0200
summary:     Silence two py3k deprecation warnings and fix a bug.
files:       src/distutils2/tests/test_upload.py, src/distutils2/version.py

diff --git a/src/distutils2/tests/test_upload.py b/src/distutils2/tests/test_upload.py
--- a/src/distutils2/tests/test_upload.py
+++ b/src/distutils2/tests/test_upload.py
@@ -116,7 +116,7 @@
         # what did we send ?
         self.assertIn('dédé', self.last_open.req.data)
         headers = dict(self.last_open.req.headers)
-        self.assertTrue(headers['Content-length'] > 2000)
+        self.assertTrue(int(headers['Content-length']) < 2000)
         self.assertTrue(headers['Content-type'].startswith('multipart/form-data'))
         self.assertEquals(self.last_open.req.get_method(), 'POST')
         self.assertEquals(self.last_open.req.get_full_url(),
diff --git a/src/distutils2/version.py b/src/distutils2/version.py
--- a/src/distutils2/version.py
+++ b/src/distutils2/version.py
@@ -197,6 +197,9 @@
     def __ge__(self, other):
         return self.__eq__(other) or self.__gt__(other)
 
+    # See http://docs.python.org/reference/datamodel#object.__hash__
+    __hash__ = object.__hash__
+
 def suggest_normalized_version(s):
     """Suggest a normalized version close to the given version string.
 

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list