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

Pulkit Goyal 7895pulkit at gmail.com
Mon Apr 11 06:14:53 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460368761 -19800
#      Mon Apr 11 15:29:21 2016 +0530
# Node ID 06aa91d331ac92d2f202f6fe40e37df22f38551f
# Parent  36983357b44533ebc59595239989af8685339610
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,7 +4,11 @@
 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.
@@ -12,12 +16,23 @@
 # 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 (
+    extensions,
+    minirst,
+    ui as uimod,
+)
+from mercurial.commands import (
+    globalopts,
+    table,
+)
+from mercurial.i18n import (
+    gettext,
+    _,
+)
+from mercurial.help import (
+    helptable,
+    loaddoc,
+)
 
 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