@@ -3552,4 +3552,174 @@ var compileTestData = []struct {
35523552 Firstlineno : 1 ,
35533553 Lnotab : "\x06 \x01 \x0b \x01 \x12 \x01 \x21 \x02 " ,
35543554 }, nil , "" },
3555+ {"import mod" , "exec" , & py.Code {
3556+ Argcount : 0 ,
3557+ Kwonlyargcount : 0 ,
3558+ Nlocals : 0 ,
3559+ Stacksize : 2 ,
3560+ Flags : 64 ,
3561+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x5a \x00 \x00 \x64 \x01 \x00 \x53 " ,
3562+ Consts : []py.Object {py .Int (0 ), py .None },
3563+ Names : []string {"mod" },
3564+ Varnames : []string {},
3565+ Freevars : []string {},
3566+ Cellvars : []string {},
3567+ Filename : "<string>" ,
3568+ Name : "<module>" ,
3569+ Firstlineno : 1 ,
3570+ Lnotab : "" ,
3571+ }, nil , "" },
3572+ {"import mod1, mod2, mod3" , "exec" , & py.Code {
3573+ Argcount : 0 ,
3574+ Kwonlyargcount : 0 ,
3575+ Nlocals : 0 ,
3576+ Stacksize : 2 ,
3577+ Flags : 64 ,
3578+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x5a \x00 \x00 \x64 \x00 \x00 \x64 \x01 \x00 \x6c \x01 \x00 \x5a \x01 \x00 \x64 \x00 \x00 \x64 \x01 \x00 \x6c \x02 \x00 \x5a \x02 \x00 \x64 \x01 \x00 \x53 " ,
3579+ Consts : []py.Object {py .Int (0 ), py .None },
3580+ Names : []string {"mod1" , "mod2" , "mod3" },
3581+ Varnames : []string {},
3582+ Freevars : []string {},
3583+ Cellvars : []string {},
3584+ Filename : "<string>" ,
3585+ Name : "<module>" ,
3586+ Firstlineno : 1 ,
3587+ Lnotab : "" ,
3588+ }, nil , "" },
3589+ {"import mod as pod, mod2 as pod2" , "exec" , & py.Code {
3590+ Argcount : 0 ,
3591+ Kwonlyargcount : 0 ,
3592+ Nlocals : 0 ,
3593+ Stacksize : 2 ,
3594+ Flags : 64 ,
3595+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x5a \x01 \x00 \x64 \x00 \x00 \x64 \x01 \x00 \x6c \x02 \x00 \x5a \x03 \x00 \x64 \x01 \x00 \x53 " ,
3596+ Consts : []py.Object {py .Int (0 ), py .None },
3597+ Names : []string {"mod" , "pod" , "mod2" , "pod2" },
3598+ Varnames : []string {},
3599+ Freevars : []string {},
3600+ Cellvars : []string {},
3601+ Filename : "<string>" ,
3602+ Name : "<module>" ,
3603+ Firstlineno : 1 ,
3604+ Lnotab : "" ,
3605+ }, nil , "" },
3606+ {"import mod1.mod2" , "exec" , & py.Code {
3607+ Argcount : 0 ,
3608+ Kwonlyargcount : 0 ,
3609+ Nlocals : 0 ,
3610+ Stacksize : 2 ,
3611+ Flags : 64 ,
3612+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x5a \x01 \x00 \x64 \x01 \x00 \x53 " ,
3613+ Consts : []py.Object {py .Int (0 ), py .None },
3614+ Names : []string {"mod1.mod2" , "mod1" },
3615+ Varnames : []string {},
3616+ Freevars : []string {},
3617+ Cellvars : []string {},
3618+ Filename : "<string>" ,
3619+ Name : "<module>" ,
3620+ Firstlineno : 1 ,
3621+ Lnotab : "" ,
3622+ }, nil , "" },
3623+ {"import mod1.mod2.mod3" , "exec" , & py.Code {
3624+ Argcount : 0 ,
3625+ Kwonlyargcount : 0 ,
3626+ Nlocals : 0 ,
3627+ Stacksize : 2 ,
3628+ Flags : 64 ,
3629+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x5a \x01 \x00 \x64 \x01 \x00 \x53 " ,
3630+ Consts : []py.Object {py .Int (0 ), py .None },
3631+ Names : []string {"mod1.mod2.mod3" , "mod1" },
3632+ Varnames : []string {},
3633+ Freevars : []string {},
3634+ Cellvars : []string {},
3635+ Filename : "<string>" ,
3636+ Name : "<module>" ,
3637+ Firstlineno : 1 ,
3638+ Lnotab : "" ,
3639+ }, nil , "" },
3640+ {"import mod1.mod2.mod3.mod4" , "exec" , & py.Code {
3641+ Argcount : 0 ,
3642+ Kwonlyargcount : 0 ,
3643+ Nlocals : 0 ,
3644+ Stacksize : 2 ,
3645+ Flags : 64 ,
3646+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x5a \x01 \x00 \x64 \x01 \x00 \x53 " ,
3647+ Consts : []py.Object {py .Int (0 ), py .None },
3648+ Names : []string {"mod1.mod2.mod3.mod4" , "mod1" },
3649+ Varnames : []string {},
3650+ Freevars : []string {},
3651+ Cellvars : []string {},
3652+ Filename : "<string>" ,
3653+ Name : "<module>" ,
3654+ Firstlineno : 1 ,
3655+ Lnotab : "" ,
3656+ }, nil , "" },
3657+ {"import mod1.mod2.mod3.mod4 as potato" , "exec" , & py.Code {
3658+ Argcount : 0 ,
3659+ Kwonlyargcount : 0 ,
3660+ Nlocals : 0 ,
3661+ Stacksize : 2 ,
3662+ Flags : 64 ,
3663+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x6a \x01 \x00 \x6a \x02 \x00 \x6a \x03 \x00 \x5a \x04 \x00 \x64 \x01 \x00 \x53 " ,
3664+ Consts : []py.Object {py .Int (0 ), py .None },
3665+ Names : []string {"mod1.mod2.mod3.mod4" , "mod2" , "mod3" , "mod4" , "potato" },
3666+ Varnames : []string {},
3667+ Freevars : []string {},
3668+ Cellvars : []string {},
3669+ Filename : "<string>" ,
3670+ Name : "<module>" ,
3671+ Firstlineno : 1 ,
3672+ Lnotab : "" ,
3673+ }, nil , "" },
3674+ {"from mod import a" , "exec" , & py.Code {
3675+ Argcount : 0 ,
3676+ Kwonlyargcount : 0 ,
3677+ Nlocals : 0 ,
3678+ Stacksize : 2 ,
3679+ Flags : 64 ,
3680+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x6d \x01 \x00 \x5a \x01 \x00 \x01 \x64 \x02 \x00 \x53 " ,
3681+ Consts : []py.Object {py .Int (0 ), py.Tuple {py .String ("a" )}, py .None },
3682+ Names : []string {"mod" , "a" },
3683+ Varnames : []string {},
3684+ Freevars : []string {},
3685+ Cellvars : []string {},
3686+ Filename : "<string>" ,
3687+ Name : "<module>" ,
3688+ Firstlineno : 1 ,
3689+ Lnotab : "" ,
3690+ }, nil , "" },
3691+ {"from mod1.mod2.mod3 import *" , "exec" , & py.Code {
3692+ Argcount : 0 ,
3693+ Kwonlyargcount : 0 ,
3694+ Nlocals : 0 ,
3695+ Stacksize : 2 ,
3696+ Flags : 64 ,
3697+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x54 \x64 \x02 \x00 \x53 " ,
3698+ Consts : []py.Object {py .Int (0 ), py.Tuple {py .String ("*" )}, py .None },
3699+ Names : []string {"mod1.mod2.mod3" },
3700+ Varnames : []string {},
3701+ Freevars : []string {},
3702+ Cellvars : []string {},
3703+ Filename : "<string>" ,
3704+ Name : "<module>" ,
3705+ Firstlineno : 1 ,
3706+ Lnotab : "" ,
3707+ }, nil , "" },
3708+ {"from mod1.mod2.mod3 import a as aa, b as bb, c" , "exec" , & py.Code {
3709+ Argcount : 0 ,
3710+ Kwonlyargcount : 0 ,
3711+ Nlocals : 0 ,
3712+ Stacksize : 2 ,
3713+ Flags : 64 ,
3714+ Code : "\x64 \x00 \x00 \x64 \x01 \x00 \x6c \x00 \x00 \x6d \x01 \x00 \x5a \x02 \x00 \x6d \x03 \x00 \x5a \x04 \x00 \x6d \x05 \x00 \x5a \x05 \x00 \x01 \x64 \x02 \x00 \x53 " ,
3715+ Consts : []py.Object {py .Int (0 ), py.Tuple {py .String ("a" ), py .String ("b" ), py .String ("c" )}, py .None },
3716+ Names : []string {"mod1.mod2.mod3" , "a" , "aa" , "b" , "bb" , "c" },
3717+ Varnames : []string {},
3718+ Freevars : []string {},
3719+ Cellvars : []string {},
3720+ Filename : "<string>" ,
3721+ Name : "<module>" ,
3722+ Firstlineno : 1 ,
3723+ Lnotab : "" ,
3724+ }, nil , "" },
35553725}
0 commit comments