Skip to content

Commit 2719465

Browse files
aisksbinet
andauthored
Update py/import.go
Co-authored-by: Sebastien Binet <binet@cern.ch>
1 parent 0e80160 commit 2719465

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

py/import.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,8 @@ func BuiltinImport(ctx Context, self Object, args Tuple, kwargs StringDict, curr
362362
return nil, err
363363
}
364364

365-
var globalsDict StringDict
366-
if globalsTyped, ok := globals.(StringDict); ok {
367-
globalsDict = globalsTyped
368-
} else {
365+
globalsDict, ok := globals.(StringDict)
366+
if !ok {
369367
if levelInt > 0 {
370368
return nil, ExceptionNewf(TypeError, "globals must be a dict")
371369
}

0 commit comments

Comments
 (0)