Skip to content

Commit b2f29b1

Browse files
committed
fix(Lib/inspect): getsourcelines not compile
1 parent 694bd9e commit b2f29b1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/pylib/Lib/inspect.nim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ wrapPyOptStr1 getsourcefile
6262
wrapPyStr1 getsource
6363
wrapPyOptStr1 getdoc
6464

65-
macro getsourcelines*(obj: typed): (PyList[string], int) =
66-
## get source code of the object
65+
template getsourcelines*(obj: typed): (PyList[PyStr], int) =
66+
## get source code of the object:
6767
##
68-
## the first element is the source code
69-
## the second element is the line number of the first line of the source code
70-
newLit getsourcelinesImpl(obj, splitlines)
68+
## - the first element is the source code
69+
## - the second element is the line number of the first line of the source code
70+
bind splitlines, getsourcelinesImpl
71+
getsourcelinesImpl(obj, splitlines)
7172

7273
# TODO:
7374
# https://docs.python.org/3/library/inspect.html#introspecting-callables-with-the-signature-object

0 commit comments

Comments
 (0)