Patchwork [5,of,7] py3: use pycompat.getcwd instead of os.getcwd

login
register
mail settings
Submitter Pulkit Goyal
Date Dec. 21, 2016, 10:03 p.m.
Message ID <0c2fad895ac20844fe29.1482357830@pulkit-goyal>
Download mbox | patch
Permalink /patch/17998/
State Accepted
Headers show

Comments

Pulkit Goyal - Dec. 21, 2016, 10:03 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1482351857 -19800
#      Thu Dec 22 01:54:17 2016 +0530
# Node ID 0c2fad895ac20844fe2947fa1a7b59280cc2698c
# Parent  6c3d7bf8e5fef7cff76a359dfe6ba627fa9ed10c
py3: use pycompat.getcwd instead of os.getcwd

Patch

diff -r 6c3d7bf8e5fe -r 0c2fad895ac2 mercurial/win32.py
--- a/mercurial/win32.py	Wed Dec 21 23:40:38 2016 +0530
+++ b/mercurial/win32.py	Thu Dec 22 01:54:17 2016 +0530
@@ -14,7 +14,10 @@ 
 import random
 import subprocess
 
-from . import encoding
+from . import (
+    encoding,
+    pycompat,
+)
 
 _kernel32 = ctypes.windll.kernel32
 _advapi32 = ctypes.windll.advapi32
@@ -440,7 +443,7 @@ 
 
     res = _kernel32.CreateProcessA(
         None, args, None, None, False, _CREATE_NO_WINDOW,
-        env, os.getcwd(), ctypes.byref(si), ctypes.byref(pi))
+        env, pycompat.getcwd(), ctypes.byref(si), ctypes.byref(pi))
     if not res:
         raise ctypes.WinError()
 
diff -r 6c3d7bf8e5fe -r 0c2fad895ac2 tests/test-check-code.t
--- a/tests/test-check-code.t	Wed Dec 21 23:40:38 2016 +0530
+++ b/tests/test-check-code.t	Thu Dec 22 01:54:17 2016 +0530
@@ -31,9 +31,6 @@ 
    > policy = os.environ.get('HGMODULEPOLICY', policy)
    use encoding.environ instead (py3)
   Skipping mercurial/statprof.py it has no-che?k-code (glob)
-  mercurial/win32.py:443:
-   >         env, os.getcwd(), ctypes.byref(si), ctypes.byref(pi))
-   use pycompat.getcwd instead (py3)
   [1]
 
 @commands in debugcommands.py should be in alphabetical order.