[PATCH 2 of 8 v2] doc: make gendoc use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Sun Apr 10 13:29:17 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460305968 -19800
#      Sun Apr 10 22:02:48 2016 +0530
# Node ID 506944cedcf31b2926315cf0c8bf566e29461e35
# Parent  bde5e8b74820301a7cfbfd98e03911c1d7111ed1
doc: make gendoc use absolute_import

diff --git a/doc/gendoc.py b/doc/gendoc.py
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -4,20 +4,36 @@
 where DOC is the name of a document
 """
 
-import os, sys, textwrap
+from __future__ import absolute_import
+
+import os
+import sys
+import textwrap
 
 # This script is executed during installs and may not have C extensions
 # available. Relax C module requirements.
 os.environ['HGMODULEPOLICY'] = 'allow'
 # import from the live mercurial repo
 sys.path.insert(0, "..")
-from mercurial import demandimport; demandimport.enable()
-from mercurial import minirst
-from mercurial.commands import table, globalopts
-from mercurial.i18n import gettext, _
-from mercurial.help import helptable, loaddoc
-from mercurial import extensions
-from mercurial import ui as uimod
+from mercurial import (
+    demandimport,
+    extensions,
+    minirst,
+    ui as uimod,
+)
+from mercurial.commands import (
+    globalopts,
+    table,
+)
+from mercurial.i18n import (
+    gettext,
+    _,
+)
+from mercurial.help import (
+    helptable,
+    loaddoc,
+)
+demandimport.enable()
 
 def get_desc(docstr):
     if not docstr:
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -4,7 +4,6 @@
 
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
   doc/check-seclevel.py not using absolute_import
-  doc/gendoc.py not using absolute_import
   hgext/color.py not using absolute_import
   hgext/eol.py not using absolute_import
   hgext/extdiff.py not using absolute_import


More information about the Mercurial-devel mailing list