Fix PY37 docstring generation
This commit is contained in:
parent
b27cdfed69
commit
258a1f5748
@ -2071,8 +2071,12 @@ class HyASTCompiler(object):
|
|||||||
body = Result()
|
body = Result()
|
||||||
|
|
||||||
# grab the doc string, if there is one
|
# grab the doc string, if there is one
|
||||||
|
docstring = None
|
||||||
if expressions and isinstance(expressions[0], HyString):
|
if expressions and isinstance(expressions[0], HyString):
|
||||||
body += self.compile(expressions.pop(0)).expr_as_stmt()
|
docstring = expressions.pop(0)
|
||||||
|
if not PY37:
|
||||||
|
body += self.compile(docstring).expr_as_stmt()
|
||||||
|
docstring = None
|
||||||
|
|
||||||
if expressions and isinstance(expressions[0], HyList) \
|
if expressions and isinstance(expressions[0], HyList) \
|
||||||
and not isinstance(expressions[0], HyExpression):
|
and not isinstance(expressions[0], HyExpression):
|
||||||
@ -2097,7 +2101,8 @@ class HyASTCompiler(object):
|
|||||||
starargs=None,
|
starargs=None,
|
||||||
kwargs=None,
|
kwargs=None,
|
||||||
bases=bases_expr,
|
bases=bases_expr,
|
||||||
body=body.stmts)
|
body=body.stmts,
|
||||||
|
docstring=(None if docstring is None else str_type(docstring)))
|
||||||
|
|
||||||
@builds("dispatch-tag-macro")
|
@builds("dispatch-tag-macro")
|
||||||
@checkargs(exact=2)
|
@checkargs(exact=2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user