diff options
author | coderick14 | 2017-05-17 15:40:18 +0530 |
---|---|---|
committer | coderick14 | 2017-05-17 15:41:00 +0530 |
commit | fe407193c200e03070928c1e2c1a6e067d32893d (patch) | |
tree | 1c492aa814754b5db5d644c769f5382306217298 /lib/python2.7/site-packages/django/utils/unittest/compatibility.py | |
parent | 9a1393e8470d855762e699abca9911b9cdae6a7d (diff) | |
download | SBHS-2018-Rpi-fe407193c200e03070928c1e2c1a6e067d32893d.tar.gz SBHS-2018-Rpi-fe407193c200e03070928c1e2c1a6e067d32893d.tar.bz2 SBHS-2018-Rpi-fe407193c200e03070928c1e2c1a6e067d32893d.zip |
Upgrade to Django 1.11
- Database integration yet to be tested
Diffstat (limited to 'lib/python2.7/site-packages/django/utils/unittest/compatibility.py')
-rw-r--r-- | lib/python2.7/site-packages/django/utils/unittest/compatibility.py | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/lib/python2.7/site-packages/django/utils/unittest/compatibility.py b/lib/python2.7/site-packages/django/utils/unittest/compatibility.py deleted file mode 100644 index a0dc499..0000000 --- a/lib/python2.7/site-packages/django/utils/unittest/compatibility.py +++ /dev/null @@ -1,64 +0,0 @@ -import os -import sys - -try: - from functools import wraps -except ImportError: - # only needed for Python 2.4 - def wraps(_): - def _wraps(func): - return func - return _wraps - -__unittest = True - -def _relpath_nt(path, start=os.path.curdir): - """Return a relative version of a path""" - - if not path: - raise ValueError("no path specified") - start_list = os.path.abspath(start).split(os.path.sep) - path_list = os.path.abspath(path).split(os.path.sep) - if start_list[0].lower() != path_list[0].lower(): - unc_path, rest = os.path.splitunc(path) - unc_start, rest = os.path.splitunc(start) - if bool(unc_path) ^ bool(unc_start): - raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)" - % (path, start)) - else: - raise ValueError("path is on drive %s, start on drive %s" - % (path_list[0], start_list[0])) - # Work out how much of the filepath is shared by start and path. - for i in range(min(len(start_list), len(path_list))): - if start_list[i].lower() != path_list[i].lower(): - break - else: - i += 1 - - rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:] - if not rel_list: - return os.path.curdir - return os.path.join(*rel_list) - -# default to posixpath definition -def _relpath_posix(path, start=os.path.curdir): - """Return a relative version of a path""" - - if not path: - raise ValueError("no path specified") - - start_list = os.path.abspath(start).split(os.path.sep) - path_list = os.path.abspath(path).split(os.path.sep) - - # Work out how much of the filepath is shared by start and path. - i = len(os.path.commonprefix([start_list, path_list])) - - rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:] - if not rel_list: - return os.path.curdir - return os.path.join(*rel_list) - -if os.path is sys.modules.get('ntpath'): - relpath = _relpath_nt -else: - relpath = _relpath_posix |