Skip to content

Commit 95ee66c

Browse files
committed
Try to fix galactics
1 parent edac04c commit 95ee66c

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/amuse/rfi/tools/python_code_script.template

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ if __name__ == '__main__':
1313
usempi = True
1414
host = None
1515
portnumber = -1
16-
17-
syspath = ({syspath})
18-
existing_syspath = set(sys.path)
19-
for x in syspath:
20-
if not x in existing_syspath:
21-
sys.path.append(x)
22-
16+
17+
sys.path = [{syspath}]
18+
2319
if usempi:
2420
from mpi4py import MPI
2521
from amuse.rfi.channel import MpiChannel
@@ -35,7 +31,7 @@ if __name__ == '__main__':
3531
from amuse.rfi.python_code import PythonImplementation
3632

3733
x = PythonImplementation(instance, {interface})
38-
34+
3935
if use_sockets:
4036
if usempi:
4137
x.start_socket_mpi(portnumber, host)

src/tests/compile_tests/test_python_implementation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ def test1(self):
418418
x.interface_class = ForTestingInterface
419419

420420
script_string = x.new_executable_script_string()
421-
self.assertTrue(script_string.find('syspath = (') > 0)
421+
print(x.new_executable_script_string())
422+
self.assertTrue(script_string.find('sys.path = [') > 0)
422423
self.assertTrue(script_string.find('ForTestingInterface') > 0)
423424
self.assertTrue(script_string.find('ForTestingImplementation') > 0)
424425
self.assertTrue(script_string.find('test_python_implementation') > 0)
@@ -435,7 +436,7 @@ def test2(self):
435436
x.interface_class = ForTestingInterface
436437

437438
script_string = x.new_executable_script_string()
438-
self.assertTrue(script_string.find('syspath = (') > 0)
439+
self.assertTrue(script_string.find('sys.path = [') > 0)
439440
self.assertTrue(script_string.find('ForTestingInterface') > 0)
440441
self.assertTrue(script_string.find('ForTestingImplementation') > 0)
441442
self.assertTrue(script_string.find('test_python_implementation') > 0)

0 commit comments

Comments
 (0)