Skip to content

Commit bb881ed

Browse files
author
Franziska Geiger
committed
Style errors fix and test fix
1 parent f6928d5 commit bb881ed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_posix.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def test_execl(self):
7575
def test_execv_with_env(self):
7676
new_file_path, cwd = self.create_file()
7777
with open(new_file_path, 'w') as script:
78-
script.write('echo $ENV_VAR> {}/test.txt\n'.format(cwd))
78+
script.write('#!/bin/sh\n')
79+
script.write('echo $ENV_VAR > {}/test.txt\n'.format(cwd))
7980
os.system("%s -c \"import os; os.environ['ENV_VAR']='the_text'; os.execv('%s', ['%s', 'the_input'])\"" % (sys.executable, new_file_path, new_file_path))
8081
assert os.path.isfile(cwd + '/test.txt')
8182
with open(cwd+'/test.txt', 'r') as result:

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PosixModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ Object doExecute(PythonModule thisModule, String path, PSequence args) {
335335
ProcessBuilder builder = new ProcessBuilder(cmd);
336336
Map<String, String> environment = builder.environment();
337337
environ.entries().forEach(entry -> {
338-
environment.put(new String(toBytes.execute(null, (PBytes) entry.key)), new String(toBytes.execute(null, (PBytes) entry.value)));
338+
environment.put(new String(toBytes.execute(null, entry.key)), new String(toBytes.execute(null, entry.value)));
339339
});
340340
Process pr = builder.start();
341341
BufferedReader bfr = new BufferedReader(new InputStreamReader(pr.getInputStream()));

0 commit comments

Comments
 (0)