diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-07-20 15:36:52 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-07-22 09:29:55 +0200 |
| commit | 0d914d08a0d7b5a1521f498a8047971fe6cd61e7 (patch) | |
| tree | d0ab08b0b5b2041bd796c10a26a358ae60d0914a /django/core/files/storage.py | |
| parent | bdca5ea345c548a82a80d198906818c9ccbef896 (diff) | |
[py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases
to keey it easy to identify where the functions come from.
Diffstat (limited to 'django/core/files/storage.py')
| -rw-r--r-- | django/core/files/storage.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/core/files/storage.py b/django/core/files/storage.py index ba88674dbd..5179980513 100644 --- a/django/core/files/storage.py +++ b/django/core/files/storage.py @@ -1,6 +1,9 @@ import os import errno -import urlparse +try: + from urllib.parse import urljoin +except ImportError: # Python 2 + from urlparse import urljoin import itertools from datetime import datetime @@ -252,7 +255,7 @@ class FileSystemStorage(Storage): def url(self, name): if self.base_url is None: raise ValueError("This file is not accessible via a URL.") - return urlparse.urljoin(self.base_url, filepath_to_uri(name)) + return urljoin(self.base_url, filepath_to_uri(name)) def accessed_time(self, name): return datetime.fromtimestamp(os.path.getatime(self.path(name))) |
