diff contrib/automation/hgautomation/winrm.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents e91930d712e8
children 6a350194de7f
line wrap: on
line diff
--- a/contrib/automation/hgautomation/winrm.py	Sat Oct 05 10:29:34 2019 -0400
+++ b/contrib/automation/hgautomation/winrm.py	Sun Oct 06 09:45:02 2019 -0400
@@ -11,9 +11,7 @@
 import pprint
 import time
 
-from pypsrp.client import (
-    Client,
-)
+from pypsrp.client import Client
 from pypsrp.powershell import (
     PowerShell,
     PSInvocationState,
@@ -35,8 +33,13 @@
 
     while True:
         try:
-            client = Client(host, username=username, password=password,
-                            ssl=ssl, connection_timeout=5)
+            client = Client(
+                host,
+                username=username,
+                password=password,
+                ssl=ssl,
+                connection_timeout=5,
+            )
             client.execute_ps("Write-Host 'Hello, World!'")
             return client
         except requests.exceptions.ConnectionError:
@@ -78,5 +81,7 @@
             print(format_object(o))
 
         if ps.state == PSInvocationState.FAILED:
-            raise Exception('PowerShell execution failed: %s' %
-                            ' '.join(map(format_object, ps.streams.error)))
+            raise Exception(
+                'PowerShell execution failed: %s'
+                % ' '.join(map(format_object, ps.streams.error))
+            )