Skip to content

Commit c5905e8

Browse files
committed
some os.system changes:
1 parent 95c528a commit c5905e8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

os/os.module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func system(self py.Object, args py.Tuple) (py.Object, error) {
180180
if !ok {
181181
return nil, py.ExceptionNewf(py.TypeError, "str expected (pos 1), not"+args[0].Type().Name)
182182
}
183-
carg := strings.ReplaceAll(string(_carg), "'", "")
183+
carg := strings.ReplaceAll(string(_carg), "'", "\"")
184184

185185
var command *exec.Cmd
186186
if runtime.GOOS != "windows" {

os/os.test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ def _fail(test_name):
181181
_fail('os.system("pwd")')
182182
failed+=1
183183

184+
print(bcolors.ENDC)
185+
186+
if os.system("echo \"test passed\"") == 0:
187+
_pass('os.system("echo \"test passed\"")')
188+
passed_tests+=1
189+
else:
190+
_fail('os.system("echo \"test passed\"")')
191+
failed+=1
184192

185193
print()
186194
print(bcolors.ENDC+bcolors.BOLD+bcolors.HEADER+"----- Results -----")

0 commit comments

Comments
 (0)