Commit db4241cf authored by Stefan Behnel's avatar Stefan Behnel

Remove Py2.4- compatibility fallback.

parent 0e8bc15d
...@@ -21,6 +21,7 @@ import warnings ...@@ -21,6 +21,7 @@ import warnings
import zlib import zlib
import glob import glob
from contextlib import contextmanager from contextlib import contextmanager
from collections import defaultdict
try: try:
import platform import platform
...@@ -46,26 +47,6 @@ try: ...@@ -46,26 +47,6 @@ try:
except ImportError: # No threads, no problems except ImportError: # No threads, no problems
threading = None threading = None
try:
from collections import defaultdict
except ImportError:
class defaultdict(object):
def __init__(self, default_factory=lambda : None):
self._dict = {}
self.default_factory = default_factory
def __getitem__(self, key):
if key not in self._dict:
self._dict[key] = self.default_factory()
return self._dict[key]
def __setitem__(self, key, value):
self._dict[key] = value
def __contains__(self, key):
return key in self._dict
def __repr__(self):
return repr(self._dict)
def __nonzero__(self):
return bool(self._dict)
try: try:
from unittest import SkipTest from unittest import SkipTest
except ImportError: except ImportError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment