在我的应用程序中,直到现在我一直在使用flask-caching 1.0
,但现在我必须升级它以version 1.8
使用新引入的更改,但是在 python 2.7 中它给出属性错误AttributeError: 'module' object has no attribute 'signature'
,我可以看到在 python 2.7 版本inspect
模块中没有可用的属性签名。
堆栈跟踪
ERROR:flask_caching:Exception possibly due to cache backend.
Traceback (most recent call last):
File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 795, in decorated_function
f, *args, **kwargs
File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 592, in make_cache_key
f, args=args, timeout=_timeout, forced_update=forced_update
File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 529, in _memoize_version
fname, instance_fname = function_namespace(f, args=args)
File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 80, in function_namespace
m_args = get_arg_names(f)
File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 59, in get_arg_names
sig = inspect.signature(f)
AttributeError: 'module' object has no attribute 'signature'
任何解决问题的建议。