[wwwsearch-commits] r17753 - wwwsearch/ClientForm/trunk
jjlee at codespeak.net
jjlee at codespeak.net
Thu Sep 22 00:49:02 CEST 2005
Author: jjlee
Date: Thu Sep 22 00:48:57 2005
New Revision: 17753
Modified:
wwwsearch/ClientForm/trunk/ClientForm.py
Log:
Fix <=2.2 compat. bug; Remove support for (pre-2.0) Pythons lacking unicode type
Modified: wwwsearch/ClientForm/trunk/ClientForm.py
==============================================================================
--- wwwsearch/ClientForm/trunk/ClientForm.py (original)
+++ wwwsearch/ClientForm/trunk/ClientForm.py Thu Sep 22 00:48:57 2005
@@ -86,12 +86,6 @@
htmlentitydefs, re
from urlparse import urljoin
from cStringIO import StringIO
-try:
- from types import UnicodeType
-except ImportError:
- UNICODE = False
-else:
- UNICODE = True
try:
import warnings
@@ -158,7 +152,7 @@
if type(v) == types.StringType:
v = urllib.quote_plus(v)
l.append(k + '=' + v)
- elif UNICODE and type(v) == types.UnicodeType:
+ elif type(v) == types.UnicodeType:
# is there a reasonable way to convert to ASCII?
# encode generates a string, but "replace" or "ignore"
# lose information and "strict" can raise UnicodeError
@@ -266,7 +260,7 @@
except AttributeError:
pid = '1'
_prefix = hostid + uid + pid
- return "%s%d%d" % (_prefix, int(time.time()*100), _get_next_counter())
+ return "%s%d%d" % (_prefix, long(time.time()*100), _get_next_counter())
# end of code from mimetools module
# --------------------------------------------------------------------
More information about the wwwsearch-commits
mailing list