diff options
| author | Tim Graham <timograham@gmail.com> | 2015-06-10 17:24:04 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-25 06:02:21 -0400 |
| commit | e2ea30c4403fca1b0a2032aae7a783f8705fc08b (patch) | |
| tree | 3f4f39f8422db192425cdde82d1af1344df5fc22 /django/core | |
| parent | 84ec3bfc1111525ee0b21afff870840b2eb13771 (diff) | |
[1.8.x] Fixed #24979 -- Removed usage of inspect.getargspec().
Backport of 3872a33132a4bb6aa22b237927597bbfdf6f21d7 from master
Diffstat (limited to 'django/core')
| -rw-r--r-- | django/core/files/storage.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/core/files/storage.py b/django/core/files/storage.py index e611d3ac7b..39cf5d800b 100644 --- a/django/core/files/storage.py +++ b/django/core/files/storage.py @@ -2,7 +2,6 @@ import errno import os import warnings from datetime import datetime -from inspect import getargspec from django.conf import settings from django.core.exceptions import SuspiciousFileOperation @@ -14,6 +13,7 @@ from django.utils.deconstruct import deconstructible from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import filepath_to_uri, force_text from django.utils.functional import LazyObject +from django.utils.inspect import func_supports_parameter from django.utils.module_loading import import_string from django.utils.six.moves.urllib.parse import urljoin from django.utils.text import get_valid_filename @@ -49,8 +49,7 @@ class Storage(object): if not hasattr(content, 'chunks'): content = File(content) - args, varargs, varkw, defaults = getargspec(self.get_available_name) - if 'max_length' in args: + if func_supports_parameter(self.get_available_name, 'max_length'): name = self.get_available_name(name, max_length=max_length) else: warnings.warn( |
