--- a/mercurial/pycompat.py Thu Mar 09 20:53:14 2017 -0800
+++ b/mercurial/pycompat.py Sat Mar 11 13:53:14 2017 -0500
@@ -69,7 +69,8 @@
#
# TODO: On Windows, the native argv is wchar_t, so we'll need a different
# workaround to simulate the Python 2 (i.e. ANSI Win32 API) behavior.
- sysargv = list(map(os.fsencode, sys.argv))
+ if getattr(sys, 'argv', None) is not None:
+ sysargv = list(map(os.fsencode, sys.argv))
def bytechr(i):
return bytes([i])
@@ -173,7 +174,8 @@
stdin = sys.stdin
stdout = sys.stdout
stderr = sys.stderr
- sysargv = sys.argv
+ if getattr(sys, 'argv', None) is not None:
+ sysargv = sys.argv
sysplatform = sys.platform
getcwd = os.getcwd
sysexecutable = sys.executable