summaryrefslogtreecommitdiff
path: root/httpretty/compat.py
diff options
context:
space:
mode:
authorGabriel Falcão <gabriel@nacaolivre.org>2015-12-13 07:41:35 -0200
committerGabriel Falcão <gabriel@nacaolivre.org>2015-12-13 07:41:35 -0200
commitc813340b664fdd52635c143c7806f30441c0ab30 (patch)
tree54aaca07b4b63dafdb46537f3231632fbb06f6a2 /httpretty/compat.py
parent947c47e7dfc45e21d2725d11085a8107076e0f81 (diff)
downloadhttpretty-c813340b664fdd52635c143c7806f30441c0ab30.tar.gz
revamping docs + tests
Diffstat (limited to 'httpretty/compat.py')
-rw-r--r--httpretty/compat.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/httpretty/compat.py b/httpretty/compat.py
index 6805cf6..803b55d 100644
--- a/httpretty/compat.py
+++ b/httpretty/compat.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# <HTTPretty - HTTP client mock for Python>
-# Copyright (C) <2011-2013> Gabriel Falcão <gabriel@nacaolivre.org>
+# Copyright (C) <2011-2015> Gabriel Falcão <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -37,9 +37,6 @@ if PY3: # pragma: no cover
StringIO = io.BytesIO
basestring = (str, bytes)
- class BaseClass(object):
- def __repr__(self):
- return self.__str__()
else: # pragma: no cover
text_type = unicode
byte_type = str
@@ -49,6 +46,7 @@ else: # pragma: no cover
class BaseClass(object):
+
def __repr__(self):
ret = self.__str__()
if PY3: # pragma: no cover
@@ -58,11 +56,17 @@ class BaseClass(object):
try: # pragma: no cover
- from urllib.parse import urlsplit, urlunsplit, parse_qs, quote, quote_plus, unquote
+ from urllib.parse import urlsplit
+ from urllib.parse import urlunsplit
+ from urllib.parse import parse_qs
+ from urllib.parse import quote
+ from urllib.parse import quote_plus
+ from urllib.parse import unquote
unquote_utf8 = unquote
except ImportError: # pragma: no cover
from urlparse import urlsplit, urlunsplit, parse_qs, unquote
from urllib import quote, quote_plus
+
def unquote_utf8(qs):
if isinstance(qs, text_type):
qs = qs.encode('utf-8')