diff options
| author | Steve Pulec <spulec@gmail.com> | 2013-02-14 01:17:01 -0500 |
|---|---|---|
| committer | Steve Pulec <spulec@gmail.com> | 2013-02-14 01:17:01 -0500 |
| commit | 6d365ac1a19f235e6d76ba3060669ee2573a4326 (patch) | |
| tree | 39e66950d888aef4281b598722894a79503eeadc | |
| parent | 5dd66a05362f6fdf2a2fdef2c49d63bc1ffa75ba (diff) | |
| download | httpretty-6d365ac1a19f235e6d76ba3060669ee2573a4326.tar.gz | |
use __str__ instead of __unicode__
| -rw-r--r-- | httpretty/__init__.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/httpretty/__init__.py b/httpretty/__init__.py index d7d08e6..14973de 100644 --- a/httpretty/__init__.py +++ b/httpretty/__init__.py @@ -43,7 +43,7 @@ if PY3: class Compat_Repr(object): def __repr__(self): - return self.__unicode__() + return self.__str__() else: text_type = unicode binary_type = str @@ -52,7 +52,7 @@ else: class Compat_Repr(object): def __repr__(self): - return self.__unicode__().encode('utf-8') + return self.__str__().encode('utf-8') from datetime import datetime from datetime import timedelta @@ -134,7 +134,7 @@ class HTTPrettyRequest(BaseHTTPRequestHandler, Compat_Repr, object): self.parse_request() self.method = self.command - def __unicode__(self): + def __str__(self): return 'HTTPrettyRequest(headers={0}, body="{1}")'.format( self.headers, self.body, @@ -471,7 +471,7 @@ class Entry(Compat_Repr, object): ) ) - def __unicode__(self): + def __str__(self): return r'<Entry %s %s getting %d>' % ( self.method, self.uri, self.status) @@ -583,7 +583,7 @@ class URIInfo(Compat_Repr, object): self.current_entry += 1 return entry - def __unicode__(self): + def __str__(self): attrs = ( 'username', 'password', @@ -671,7 +671,7 @@ class HTTPretty(Compat_Repr, object): cls._entries[info] = entries_for_this_uri - def __unicode__(self): + def __str__(self): return u'<HTTPretty with %d URI entries>' % len(self._entries) @classmethod |
