Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
speed: ["slow"]

steps:
Expand Down
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Authors and Contributors
* @radixvinni;
* @ivirabyan;
* @anti-social;
* @insolor.
* @insolor;
* @kuk.

If you contributed to pymorphy2, please add yourself to this list
(or update your contact information).
Expand Down
18 changes: 16 additions & 2 deletions pymorphy2/units/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
import inspect

from pymorphy2.utils import kwargs_repr
from pymorphy2.units.utils import (
Expand All @@ -10,6 +9,21 @@
)


try:
from inspect import getargspec

def inspect_args(func):
args, varargs, kw, default = getargspec(func)
return args

except ImportError:
# inspect.getargspec was deprecated in 3.0
from inspect import getfullargspec

def inspect_args(func):
return getfullargspec(func).args


class BaseAnalyzerUnit(object):
"""
Base class for analyzer units.
Expand Down Expand Up @@ -67,7 +81,7 @@ def _get_param_names(cls):
"""
if cls.__init__ is object.__init__:
return []
args, varargs, kw, default = inspect.getargspec(cls.__init__)
args = inspect_args(cls.__init__)
return sorted(args[1:])

def _get_params(self):
Expand Down