Author: phd
Date: 2005-02-11 12:20:51 +0000 (Fri, 11 Feb 2005)
New Revision: 601
Modified:
trunk/SQLObject/sqlobject/inheritance/__init__.py
trunk/SQLObject/sqlobject/tests/test_unicode.py
Log:
Minor bugfixes for Python 2.2.
Modified: trunk/SQLObject/sqlobject/inheritance/__init__.py
===================================================================
--- trunk/SQLObject/sqlobject/inheritance/__init__.py 2005-02-10 19:46:14 UTC (rev 600)
+++ trunk/SQLObject/sqlobject/inheritance/__init__.py 2005-02-11 12:20:51 UTC (rev 601)
@@ -4,6 +4,13 @@
import iteration
+try:
+ basestring
+except NameError: # Python 2.2
+ import types
+ basestring = (types.StringType, types.UnicodeType)
+
+
class InheritableSelectResults(SelectResults):
IterationClass = iteration.InheritableIteration
Modified: trunk/SQLObject/sqlobject/tests/test_unicode.py
===================================================================
--- trunk/SQLObject/sqlobject/tests/test_unicode.py 2005-02-10 19:46:14 UTC (rev 600)
+++ trunk/SQLObject/sqlobject/tests/test_unicode.py 2005-02-11 12:20:51 UTC (rev 601)
@@ -10,6 +10,15 @@
col1 = UnicodeCol()
col2 = UnicodeCol(dbEncoding='latin-1')
+try:
+ enumerate
+except NameError: # Python 2.2
+ def enumerate(list):
+ new_list = []
+ for i in range(len(list)):
+ new_list.append((i, list[0]))
+ return new_list
+
def test_create():
setupClass(Unicode1)
data = [u'\u00f0', u'test', 'ascii test']
|