Patchwork [07,of,10] hg: update top-level script to use modern import conventions

login
register
mail settings
Submitter Augie Fackler
Date Aug. 23, 2017, 2:55 p.m.
Message ID <17fdb52b44c9e97f4e66.1503500106@imladris.local>
Download mbox | patch
Permalink /patch/23236/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 23, 2017, 2:55 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1503425659 14400
#      Tue Aug 22 14:14:19 2017 -0400
# Node ID 17fdb52b44c9e97f4e66354981aeea5c3990c78c
# Parent  a513d142d47423242743902f8e94d033c8ecc563
hg: update top-level script to use modern import conventions

Patch

diff --git a/hg b/hg
--- a/hg
+++ b/hg
@@ -6,6 +6,7 @@ 
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
+from __future__ import absolute_import
 
 import os
 import sys
@@ -36,10 +37,11 @@  except ImportError:
     sys.stderr.write("(check your install and PYTHONPATH)\n")
     sys.exit(-1)
 
-import mercurial.util
-import mercurial.dispatch
-
+from mercurial import (
+    dispatch,
+    util,
+)
 for fp in (sys.stdin, sys.stdout, sys.stderr):
-    mercurial.util.setbinary(fp)
+    util.setbinary(fp)
 
-mercurial.dispatch.run()
+dispatch.run()