##// END OF EJS Templates
py3: replace sys.platform with pycompat.sysplatform (part 2 of 2)
Pulkit Goyal -
r30642:e995f00a default
parent child Browse files
Show More
@@ -169,7 +169,7 b" problematic_encodings = '''big5 big5-tw "
169 169 def extsetup(ui):
170 170 # TODO: decide use of config section for this extension
171 171 if ((not os.path.supports_unicode_filenames) and
172 (sys.platform != 'cygwin')):
172 (pycompat.sysplatform != 'cygwin')):
173 173 ui.warn(_("[win32mbcs] cannot activate on this platform.\n"))
174 174 return
175 175 # determine encoding for filename
@@ -80,7 +80,7 b' def nlinks(name):'
80 80 def parsepatchoutput(output_line):
81 81 """parses the output produced by patch and returns the filename"""
82 82 pf = output_line[14:]
83 if os.sys.platform == 'OpenVMS':
83 if pycompat.sysplatform == 'OpenVMS':
84 84 if pf[0] == '`':
85 85 pf = pf[1:-1] # Remove the quotes
86 86 else:
@@ -404,7 +404,7 b" if pycompat.sysplatform == 'cygwin':"
404 404
405 405 _needsshellquote = None
406 406 def shellquote(s):
407 if os.sys.platform == 'OpenVMS':
407 if pycompat.sysplatform == 'OpenVMS':
408 408 return '"%s"' % s
409 409 global _needsshellquote
410 410 if _needsshellquote is None:
@@ -423,7 +423,7 b" def popen(command, mode='r'):"
423 423
424 424 def testpid(pid):
425 425 '''return False if pid dead, True if running or not sure'''
426 if os.sys.platform == 'OpenVMS':
426 if pycompat.sysplatform == 'OpenVMS':
427 427 return True
428 428 try:
429 429 os.kill(pid, 0)
@@ -12,7 +12,6 b' import ctypes.util'
12 12 import os
13 13 import socket
14 14 import stat as statmod
15 import sys
16 15
17 16 from . import (
18 17 policy,
@@ -70,14 +69,14 b' def listdirpure(path, stat=False, skip=N'
70 69 return result
71 70
72 71 ffi = None
73 if modulepolicy not in policynocffi and sys.platform == 'darwin':
72 if modulepolicy not in policynocffi and pycompat.sysplatform == 'darwin':
74 73 try:
75 74 from _osutil_cffi import ffi, lib
76 75 except ImportError:
77 76 if modulepolicy == 'cffi': # strict cffi import
78 77 raise
79 78
80 if sys.platform == 'darwin' and ffi is not None:
79 if pycompat.sysplatform == 'darwin' and ffi is not None:
81 80 listdir_batch_size = 4096
82 81 # tweakable number, only affects performance, which chunks
83 82 # of bytes do we get back from getattrlistbulk
@@ -165,7 +164,7 b" if pycompat.osname != 'nt':"
165 164 _SCM_RIGHTS = 0x01
166 165 _socklen_t = ctypes.c_uint
167 166
168 if sys.platform == 'linux2':
167 if pycompat.sysplatform.startswith('linux'):
169 168 # socket.h says "the type should be socklen_t but the definition of
170 169 # the kernel is incompatible with this."
171 170 _cmsg_len_t = ctypes.c_size_t
@@ -795,7 +795,7 b' def tempfilter(s, cmd):'
795 795 cmd = cmd.replace('INFILE', inname)
796 796 cmd = cmd.replace('OUTFILE', outname)
797 797 code = os.system(cmd)
798 if sys.platform == 'OpenVMS' and code & 1:
798 if pycompat.sysplatform == 'OpenVMS' and code & 1:
799 799 code = 0
800 800 if code:
801 801 raise Abort(_("command '%s' failed: %s") %
@@ -998,7 +998,7 b' def system(cmd, environ=None, cwd=None, '
998 998 return str(val)
999 999 origcmd = cmd
1000 1000 cmd = quotecommand(cmd)
1001 if sys.platform == 'plan9' and (sys.version_info[0] == 2
1001 if pycompat.sysplatform == 'plan9' and (sys.version_info[0] == 2
1002 1002 and sys.version_info[1] < 7):
1003 1003 # subprocess kludge to work around issues in half-baked Python
1004 1004 # ports, notably bichued/python:
@@ -1020,7 +1020,7 b' def system(cmd, environ=None, cwd=None, '
1020 1020 out.write(line)
1021 1021 proc.wait()
1022 1022 rc = proc.returncode
1023 if sys.platform == 'OpenVMS' and rc & 1:
1023 if pycompat.sysplatform == 'OpenVMS' and rc & 1:
1024 1024 rc = 0
1025 1025 if rc and onerr:
1026 1026 errmsg = '%s %s' % (os.path.basename(origcmd.split(None, 1)[0]),
@@ -1383,7 +1383,7 b' def splitpath(path):'
1383 1383
1384 1384 def gui():
1385 1385 '''Are we running in a GUI?'''
1386 if sys.platform == 'darwin':
1386 if pycompat.sysplatform == 'darwin':
1387 1387 if 'SSH_CONNECTION' in encoding.environ:
1388 1388 # handle SSH access to a box where the user is logged in
1389 1389 return False
General Comments 0
You need to be logged in to leave comments. Login now