Skip to content

Commit f3681ee

Browse files
committed
Merge branch 'add-os-module' of https://github.com/glaukiol1/gpython into add-os-module
2 parents 9753244 + 03fed1a commit f3681ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

os/os.module.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ func chdir(self py.Object, args py.Tuple) (py.Object, error) {
7979
if len(args) == 0 {
8080
return nil, py.ExceptionNewf(py.TypeError, "Missing required argument 'path' (pos 1)")
8181
}
82-
if objectIsString(args[0]) {
82+
if !objectIsString(args[0]) {
83+
return nil, py.ExceptionNewf(py.TypeError, "str expected, not "+args[0].Type().Name)
84+
}
8385
dir, err := py.ReprAsString(args[0])
8486
if err != nil {
8587
return nil, py.ExceptionNewf(py.TypeError, "Failed to parse string") // never going to run

0 commit comments

Comments
 (0)