Don't emit a 'pass' statement on an empty top-level module code object
Fixes test_empty test case.
This commit is contained in:
@@ -2866,7 +2866,7 @@ void decompyle(PycRef<PycCode> code, PycModule* mod)
|
||||
printClassDocstring = false;
|
||||
// This is outside the clean check so a source block will always
|
||||
// be compilable, even if decompylation failed.
|
||||
if (clean->nodes().size() == 0)
|
||||
if (clean->nodes().size() == 0 && !code.isIdent(mod->code()))
|
||||
clean->append(new ASTNode(ASTNode::NODE_PASS));
|
||||
|
||||
inPrint = false;
|
||||
|
Reference in New Issue
Block a user