Skip to content

Commit b3078ee

Browse files
#16 fix: python3.11module 'inspect' has no attribute 'getargspec'
1 parent 17e1150 commit b3078ee

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

jsonformatter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
__all__ = ['JsonFormatter', 'basicConfig']
1414

15-
version = "0.3.1"
16-
version_info = (0, 3, 1)
15+
version_info = (0, 3, 2)
16+
version = '.'.join(str(v) for v in version_info)

jsonformatter/jsonformatter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ def wrapper(*args, **kwargs):
187187
raise TypeError('`%s` is not callable.' % func)
188188

189189
if inspect.isfunction(func):
190-
argspec = getattr(inspect, 'getfullargspec',
191-
inspect.getargspec)(func)
190+
argspec = (getattr(inspect, 'getfullargspec', None) or inspect.getargspec)(func)
192191
if argspec.args:
193192
raise TypeError(
194193
"`%s` must no Positional Parameters." % func.__name__

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import sys
1212
from setuptools import setup
1313

14+
from jsonformatter import version
15+
1416
long_description = ''
1517

1618
try:
@@ -25,7 +27,7 @@
2527

2628
setup(
2729
name='jsonformatter',
28-
version='0.3.1',
30+
version=version,
2931
description=(
3032
'Python log in json format.'
3133
),

0 commit comments

Comments
 (0)