Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] git-p4: chdir now properly sets PWD environment variable in msysGit

From: Han-Wen Nienhuys <hidden>
Date: 2016-06-15 22:45:06

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help