Skip to content

Commit

Permalink
Fix Django 3.1 ImportError
Browse files Browse the repository at this point in the history
  • Loading branch information
alorence committed Jun 11, 2020
1 parent 36edf93 commit af9b5b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modernrpc/core.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# coding: utf-8
import collections
import re
from inspect import getargspec, cleandoc

import six
from django.contrib.admindocs.utils import trim_docstring
from django.core.exceptions import ImproperlyConfigured
from django.utils import inspect
from django.utils.functional import cached_property
from django.utils.inspect import get_func_args, func_accepts_kwargs

from modernrpc.conf import settings
from modernrpc.utils import ensure_sequence, get_modernrpc_logger
Expand Down Expand Up @@ -57,9 +57,9 @@ def __init__(self, func):
# for global functions.
# For Python 2, we will prefer django.utils.inspect.getargspec(func)[0]. This will work as expected, even if
# the function has been removed in Django 2.0, since Django 2 doesn't work with Python 2
self.args = inspect.get_func_args(func) if six.PY3 else inspect.getargspec(func)[0]
self.args = get_func_args(func) if six.PY3 else getargspec(func)[0]
# Does the method accept additional kwargs dict?
self.accept_kwargs = inspect.func_accepts_kwargs(func)
self.accept_kwargs = func_accepts_kwargs(func)

# Contains the signature of the method, as returned by "system.methodSignature"
self.signature = []
Expand Down Expand Up @@ -109,7 +109,7 @@ def parse_docstring(self, content):
raw_docstring = ''
# We use the helper defined in django admindocs app to remove indentation chars from docstring,
# and parse it as title, body, metadata. We don't use metadata for now.
docstring = trim_docstring(content)
docstring = cleandoc(content)

for line in docstring.split('\n'):

Expand Down

0 comments on commit af9b5b7

Please sign in to comment.