summaryrefslogtreecommitdiff
path: root/extras/py3k/fixes.diff
blob: 10c4f57da10e7e49686a6745e33f00ee79d365e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- sqlparse/sql.py~	2009-04-30 08:38:16.000000000 +0200
+++ sqlparse/sql.py	2009-04-30 08:39:15.000000000 +0200
@@ -23,16 +23,13 @@
         self.ttype = ttype
 
     def __str__(self):
-        return str(self).encode('utf-8')
+        return self.value or ''
 
     def __repr__(self):
         short = self._get_repr_value()
         return '<%s \'%s\' at 0x%07x>' % (self._get_repr_name(),
                                           short, id(self))
 
-    def __unicode__(self):
-        return self.value or ''
-
     def to_unicode(self):
         """Returns a unicode representation of this object."""
         return str(self)
@@ -105,11 +102,8 @@
         self.tokens = tokens
         Token.__init__(self, None, None)
 
-    def __unicode__(self):
-        return ''.join(str(x) for x in self.flatten())
-
     def __str__(self):
-        return str(self).encode('utf-8')
+        return ''.join(str(x) for x in self.flatten())
 
     def _get_repr_name(self):
         return self.__class__.__name__