equal
deleted
inserted
replaced
24 pycompat, |
24 pycompat, |
25 win32, |
25 win32, |
26 ) |
26 ) |
27 |
27 |
28 try: |
28 try: |
29 import _winreg as winreg |
29 import _winreg as winreg # pytype: disable=import-error |
30 |
30 |
31 winreg.CloseKey |
31 winreg.CloseKey |
32 except ImportError: |
32 except ImportError: |
33 import winreg |
33 # py2 only |
|
34 import winreg # pytype: disable=import-error |
34 |
35 |
35 osutil = policy.importmod('osutil') |
36 osutil = policy.importmod('osutil') |
36 |
37 |
37 getfsmountpoint = win32.getvolumename |
38 getfsmountpoint = win32.getvolumename |
38 getfstype = win32.getfstype |
39 getfstype = win32.getfstype |
280 def setbinary(fd): |
281 def setbinary(fd): |
281 # When run without console, pipes may expose invalid |
282 # When run without console, pipes may expose invalid |
282 # fileno(), usually set to -1. |
283 # fileno(), usually set to -1. |
283 fno = getattr(fd, 'fileno', None) |
284 fno = getattr(fd, 'fileno', None) |
284 if fno is not None and fno() >= 0: |
285 if fno is not None and fno() >= 0: |
285 msvcrt.setmode(fno(), os.O_BINARY) |
286 msvcrt.setmode(fno(), os.O_BINARY) # pytype: disable=module-attr |
286 |
287 |
287 |
288 |
288 def pconvert(path): |
289 def pconvert(path): |
289 return path.replace(pycompat.ossep, b'/') |
290 return path.replace(pycompat.ossep, b'/') |
290 |
291 |