Skip to content

Commit cc531cf

Browse files
committed
Fix call to code_deparse call in deparse_code2str
Fixes #275
1 parent c7124ad commit cc531cf

File tree

2 files changed

+728
-575
lines changed

2 files changed

+728
-575
lines changed

pytest/test_pysource.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def iteritems(d):
1515
def iteritems(d):
1616
return d.iteritems()
1717

18-
from uncompyle6.semantics.pysource import SourceWalker as SourceWalker
18+
from uncompyle6.semantics.pysource import (SourceWalker, deparse_code2str)
1919

2020
def test_template_engine():
2121
s = StringIO()
@@ -185,3 +185,11 @@ def test_tables():
185185
assert arg == len(entry), (
186186
"%s[%s] arg %d should be length of entry %d. Full entry: %s" %
187187
(name, k, arg, len(entry), entry))
188+
189+
def test_deparse_code2str():
190+
def deparse_test(co):
191+
"This is a docstring"
192+
s = deparse_code2str(co, debug_opts={"asm": "after", "tree": True})
193+
assert s
194+
return
195+
deparse_test(deparse_test.__code__)

0 commit comments

Comments
 (0)