Skip to content

Commit 2909321

Browse files
committed
Use getfullargspec over deprecated getargspec on PY3
This fixes #188
1 parent e5b9237 commit 2909321

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sass.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,16 @@ def from_lambda(cls, name, lambda_):
107107
:rtype: :class:`SassFunction`
108108
109109
"""
110-
argspec = inspect.getargspec(lambda_)
111-
if argspec.varargs or argspec.keywords or argspec.defaults:
110+
if PY3:
111+
argspec = inspect.getfullargspec(lambda_)
112+
varargs, varkw, defaults = (argspec.varargs, argspec.varkw,
113+
argspec.defaults)
114+
else:
115+
argspec = inspect.getargspec(lambda_)
116+
varargs, varkw, defaults = (argspec.varargs, argspec.keywords,
117+
argspec.defaults)
118+
119+
if varargs or varkw or defaults:
112120
raise TypeError(
113121
'functions cannot have starargs or defaults: {0} {1}'.format(
114122
name, lambda_

0 commit comments

Comments
 (0)