Robert Blum escreveu:
P4 on Windows expects the PWD environment variable to be set to the
current working dir, but os.chdir in python doesn't do that by default
+if os.name == 'nt':
+ def os_chdir(dir):
+ os.environ['PWD']=dir
+ os.chdir(dir)
+else:
+ os_chdir = os.chdir
+
Stylistic:
I think the naming is a bit ugly (os_); I would write
def chdir(d):
if os.name == 'nt': ..
os.chdir(dir)
for the rest: looks good to me.
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen