You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Everything in the else block show up as undefined.
try:
importdisexceptImportError:
def_get_code_lines(code):
raiseNotImplementedErrorelse:
def_get_code_lines(code):
ifnotisinstance(code, types.CodeType):
path=codewithopen(path) asf:
src=f.read()
code=compile(src, path, 'exec', 0, dont_inherit=True)
return_get_code_lines(code)
defiterate():
# First, get all line starts for this code object. This does not include# bodies of nested class and function definitions, as they have their# own objects.for_, linenoindis.findlinestarts(code):
yieldlineno# For nested class and function definitions, their respective code objects# are constants referenced by this object.forconstincode.co_consts:
ifisinstance(const, types.CodeType) andconst.co_filename==code.co_filename:
forlinenoin_get_code_lines(const):
yieldlinenoreturniterate()