D1019: logtoprocess: do not use platform.system()

quark (Jun Wu) phabricator at mercurial-scm.org
Thu Oct 12 00:57:41 UTC 2017


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  See the previous patch for the reason.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1019

AFFECTED FILES
  hgext/logtoprocess.py

CHANGE DETAILS

diff --git a/hgext/logtoprocess.py b/hgext/logtoprocess.py
--- a/hgext/logtoprocess.py
+++ b/hgext/logtoprocess.py
@@ -40,16 +40,19 @@
 import subprocess
 import sys
 
-from mercurial import encoding
+from mercurial import (
+    encoding,
+    pycompat,
+)
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
 def uisetup(ui):
-    if platform.system() == 'Windows':
+    if pycompat.osname == 'nt':
         # no fork on Windows, but we can create a detached process
         # https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863.aspx
         # No stdlib constant exists for this value



To: quark, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list