Skip to content

Commit 0e80160

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

py/import.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ func BuiltinImport(ctx Context, self Object, args Tuple, kwargs StringDict, curr
357357
if !ok {
358358
return nil, ExceptionNewf(TypeError, "__import__() argument 5 must be int, not %s", level.Type().Name)
359359
}
360-
levelInt := int(levelObj)
360+
levelInt, err := levelObj.GoInt()
361+
if err != nil {
362+
return nil, err
363+
}
361364

362365
var globalsDict StringDict
363366
if globalsTyped, ok := globals.(StringDict); ok {

0 commit comments

Comments
 (0)