Sfoglia il codice sorgente

Python 2.3 is no longer supported

Mike Naberezny 13 anni fa
parent
commit
c81e32b96a
6 ha cambiato i file con 5 aggiunte e 31 eliminazioni
  1. 0 7
      setup.py
  2. 1 1
      supervisor/datatypes.py
  3. 0 1
      supervisor/options.py
  4. 1 4
      supervisor/supervisord.py
  5. 0 13
      supervisor/tests/__init__.py
  6. 3 5
      tox.ini

+ 0 - 7
setup.py

@@ -22,13 +22,6 @@ if sys.version_info[:2] < (2, 4) or sys.version_info[0] > 2:
     sys.stderr.write(msg)
     sys.exit(1)
 
-import urllib
-import urllib2
-if not hasattr(urllib2, 'splituser'):
-    # setuptools wants to import this from urllib2 but it's not
-    # in there in Python 2.3.3, so we just alias it.
-    urllib2.splituser = urllib.splituser
-
 requires = ['setuptools', 'meld3 >= 0.6.5']
 
 if sys.version_info[:2] < (2, 5):

+ 1 - 1
supervisor/datatypes.py

@@ -23,7 +23,7 @@ def integer(value):
         return int(value)
     except ValueError:
         return long(value) # why does this help? (CM)
-    except OverflowError: # pragma: no cover (python 2.3)
+    except OverflowError:
         return long(value)
 
 TRUTHY_STRINGS = ('yes', 'true', 'on', '1')

+ 0 - 1
supervisor/options.py

@@ -1921,7 +1921,6 @@ def split_namespec(namespec):
     return group_name, process_name
 
 def dedupe(L):
-    # cant use sets, they dont exist in 2.3
     D = {}
     for thing in L:
         D[thing] = 1

+ 1 - 4
supervisor/supervisord.py

@@ -330,10 +330,7 @@ def profile(cmd, globals, locals, sort_order, callers):
     import tempfile
     fd, fn = tempfile.mkstemp()
     try:
-        if hasattr(profile, 'runctx'):
-            profile.runctx(cmd, globals, locals, fn)
-        else:
-            raise NotImplementedError('No profiling support under Python 2.3')
+        profile.runctx(cmd, globals, locals, fn)
         stats = pstats.Stats(fn)
         stats.strip_dirs()
         # calls,time,cumulative and cumulative,calls,time are useful

+ 0 - 13
supervisor/tests/__init__.py

@@ -1,14 +1 @@
 # this is a package
-from unittest import TestCase
-def assertTrue(self, value, extra=None):
-    if not value:
-        raise AssertionError(extra)
-def assertFalse(self, value, extra=None):
-    if value:
-        raise AssertionError(extra)
-
-if not hasattr(TestCase, 'assertTrue'): # Python 2.3.3
-    TestCase.assertTrue = assertTrue
-
-if not hasattr(TestCase, 'assertFalse'): # Python 2.3.3
-    TestCase.assertFalse = assertFalse

+ 3 - 5
tox.ini

@@ -1,11 +1,9 @@
 [tox]
-envlist = 
+envlist =
     py24,py25,py26,py27
-# should really have 2.3 in there but i cant built it easily anymore
-# coverage tests fail due to some logger error
 
 [testenv]
-commands = 
+commands =
     python setup.py test -q
 deps =
     mock >= 0.5.0
@@ -14,7 +12,7 @@ deps =
 [testenv:cover]
 basepython =
     python2.6
-commands = 
+commands =
     python setup.py nosetests --with-xunit --with-xcoverage
 deps =
     mock >= 0.5.0