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

login
register
mail settings
Submitter phabricator
Date Oct. 13, 2017, 2:05 p.m.
Message ID <f4e21d1ecc7cc0c0a288caf082be20a5@localhost.localdomain>
Download mbox | patch
Permalink /patch/24824/
State Not Applicable
Headers show

Comments

phabricator - Oct. 13, 2017, 2:05 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG68ed3b4f86ef: logtoprocess: do not use platform.system() (authored by quark, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1019?vs=2606&id=2678#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1019?vs=2606&id=2678

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

AFFECTED FILES
  hgext/logtoprocess.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/logtoprocess.py b/hgext/logtoprocess.py
--- a/hgext/logtoprocess.py
+++ b/hgext/logtoprocess.py
@@ -36,20 +36,22 @@ 
 
 import itertools
 import os
-import platform
 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