Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed unused compat code
  • Loading branch information
maryokhin committed Dec 4, 2014
commit 001884a1927f6ceaa60dcc2a4df3422f94455311
27 changes: 0 additions & 27 deletions rest_framework/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ def clean_manytomany_helptext(text):
pass


# UserDict moves in Python 3
try:
from UserDict import UserDict
from UserDict import DictMixin
except ImportError:
from collections import UserDict
from collections import MutableMapping as DictMixin


def get_model_name(model_cls):
try:
return model_cls._meta.model_name
Expand Down Expand Up @@ -177,11 +168,6 @@ def generic(self, method, path,
'CONTENT_TYPE': six.text_type(content_type),
'wsgi.input': FakePayload(data),
})
elif django.VERSION <= (1, 4):
# For 1.3 we need an empty WSGI payload
r.update({
'wsgi.input': FakePayload('')
})
r.update(extra)
return self.request(**r)

Expand Down Expand Up @@ -278,16 +264,3 @@ def check_nonce(request, oauth_request, oauth_nonce, oauth_timestamp):
else:
SHORT_SEPARATORS = (b',', b':')
LONG_SEPARATORS = (b', ', b': ')


# Handle lazy strings across Py2/Py3
from django.utils.functional import Promise

if six.PY3:
def is_non_str_iterable(obj):
if isinstance(obj, str) or (isinstance(obj, Promise) and obj._delegate_text):
return False
return hasattr(obj, '__iter__')
else:
def is_non_str_iterable(obj):
return hasattr(obj, '__iter__')