A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tesh: try harder to not loose the cwd between threads
[simgrid.git]
/
tools
/
tesh
/
tesh.py
diff --git
a/tools/tesh/tesh.py
b/tools/tesh/tesh.py
index
b75ab27
..
5ba29b8
100755
(executable)
--- a/
tools/tesh/tesh.py
+++ b/
tools/tesh/tesh.py
@@
-188,7
+188,7
@@
class TeshState(Singleton):
t.acquire()
t.release()
t.acquire()
t.release()
-#Command line object
+#
Command line object
class Cmd(object):
def __init__(self):
self.input_pipe = []
class Cmd(object):
def __init__(self):
self.input_pipe = []
@@
-199,7
+199,8
@@
class Cmd(object):
self.linenumber = -1
self.background = False
self.linenumber = -1
self.background = False
- self.cwd = None
+ # Python threads loose the cwd
+ self.cwd = os.getcwd()
self.ignore_output = False
self.expect_return = 0
self.ignore_output = False
self.expect_return = 0
@@
-259,8
+260,6
@@
class Cmd(object):
def run_if_possible(self):
if self.can_run():
if self.background:
def run_if_possible(self):
if self.can_run():
if self.background:
- #Python threads loose the cwd
- self.cwd = os.getcwd()
lock = _thread.allocate_lock()
lock.acquire()
TeshState().add_thread(lock)
lock = _thread.allocate_lock()
lock.acquire()
TeshState().add_thread(lock)
@@
-273,10
+272,8
@@
class Cmd(object):
def _run(self, lock=None):
def _run(self, lock=None):
- #Python threads loose the cwd
- if self.cwd is not None:
- os.chdir(self.cwd)
- self.cwd = None
+ # Python threads loose the cwd
+ os.chdir(self.cwd)
#retrocompatibility: support ${aaa:=.} variable format
def replace_perl_variables(m):
#retrocompatibility: support ${aaa:=.} variable format
def replace_perl_variables(m):