Skip to content

Commit 763228f

Browse files
committed
Python 2.3 workarounds cleanup
1 parent 1a131fd commit 763228f

File tree

10 files changed

+5
-39
lines changed

10 files changed

+5
-39
lines changed

roundup/anypy/TODO.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
Python compatiblity TODO
22
~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
- the popen2 module is deprecated as of Python 2.6;
5-
the subprocess module is available since Python 2.4,
6-
thus a roundup.anypy.subprocess_ module is needed
7-
8-
# vim: si
4+
Remove sets_ included for Python 2.3 compatibility.

roundup/backends/__init__.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,9 @@ def get_backend(name):
4040
return vars[name]
4141
# import the backend module
4242
module_name = 'back_%s' % name
43-
try:
44-
module = __import__(module_name, vars)
45-
except:
46-
# import failed, but in versions prior to 2.4, a (broken)
47-
# module is left in sys.modules and package globals;
48-
# subsequent imports would succeed and get the broken module.
49-
# This no longer happens in Python 2.4 and later.
50-
if sys.version_info < (2, 4):
51-
del sys.modules['.'.join((__name__, module_name))]
52-
del vars[module_name]
53-
raise
54-
else:
55-
vars[name] = module
56-
return module
43+
module = __import__(module_name, vars)
44+
vars[name] = module
45+
return module
5746

5847
def have_backend(name):
5948
'''Is backend "name" available?'''

roundup/backends/indexer_common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import re
2-
# Python 2.3 ... 2.6 compatibility:
3-
from roundup.anypy.sets_ import set
42

53
from roundup import hyperdb
64

roundup/backends/indexer_rdbms.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
propname, itemid) instances.
44
"""
55
import re
6-
# Python 2.3 ... 2.6 compatibility:
7-
from roundup.anypy.sets_ import set
86

97
from roundup.backends.indexer_common import Indexer as IndexerBase
108

roundup/hyperdb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
# standard python modules
2424
import os, re, shutil, weakref
25-
# Python 2.3 ... 2.6 compatibility:
26-
from roundup.anypy.sets_ import set
2725

2826
# roundup modules
2927
import date, password

run_tests.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,7 @@ def process_args(argv=None):
813813
gc.set_debug(gcdebug)
814814

815815
if build:
816-
# Python 2.3 is more sane in its non -q output
817-
if sys.hexversion >= 0x02030000:
818-
qflag = ""
819-
else:
820-
qflag = "-q"
821-
cmd = sys.executable + " setup.py " + qflag + " build"
816+
cmd = sys.executable + " setup.py build"
822817
if build_inplace:
823818
cmd += "_ext -i"
824819
if VERBOSE:

scripts/import_sf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
"""
2323

2424
import sys, os, csv, time, urllib2, httplib, mimetypes, urlparse
25-
# Python 2.3 ... 2.6 compatibility:
26-
from roundup.anypy.sets_ import set
2725

2826
try:
2927
import cElementTree as ElementTree

share/roundup/templates/classic/detectors/nosyreaction.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
1818

19-
# Python 2.3 ... 2.6 compatibility:
20-
from roundup.anypy.sets_ import set
21-
2219
from roundup import roundupdb, hyperdb
2320

2421
def nosyreaction(db, cl, nodeid, oldvalues):

test/db_test_base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import unittest, os, shutil, errno, imp, sys, time, pprint, base64, os.path
1919
import gpgmelib
20-
# Python 2.3 ... 2.6 compatibility:
21-
from roundup.anypy.sets_ import set
2220
from email.parser import FeedParser
2321

2422
from roundup.hyperdb import String, Password, Link, Multilink, Date, \

test/test_anypy_hashlib.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def test_sha_expected(self):
107107
for src, SHA, MD5 in self.data_for_test:
108108
self.assertEqual(sha.sha(src).hexdigest(), SHA)
109109

110-
# fails for me with Python 2.3; unittest module bug?
111110
def test_sha_new_expected(self):
112111
"""sha.new is sha.sha, or at least yields expected results"""
113112
if sha.new is sha.sha:

0 commit comments

Comments
 (0)