Patchwork [4,of,7,V3] statprof: use absolute_imports

mail settings
Submitter Gregory Szorc
Date Nov. 2, 2016, 2:11 a.m.
Message ID <68386b992feb59ec53f4.1478052668@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/17267/
State Accepted
Headers show


Gregory Szorc - Nov. 2, 2016, 2:11 a.m.
# HG changeset patch
# User Gregory Szorc <>
# Date 1478051730 25200
#      Tue Nov 01 18:55:30 2016 -0700
# Node ID 68386b992feb59ec53f4d86ae2a4fd57613d6e77
# Parent  4cd53260f947639e140a61b0698d9da1032d3794
statprof: use absolute_imports

As part of this, we modify import order to satisfy our import


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -102,12 +102,22 @@  significantly off if other threads' work
 main thread's work patterns.
 # no-check-code
-from __future__ import division
+from __future__ import absolute_import, division
-import inspect, json, os, signal, tempfile, sys, getopt, threading
+import collections
+import contextlib
+import getopt
+import inspect
+import json
+import os
+import signal
+import sys
+import tempfile
+import threading
 import time
-from collections import defaultdict
-from contextlib import contextmanager
+defaultdict = collections.defaultdict
+contextmanager = contextlib.contextmanager
 __all__ = ['start', 'stop', 'reset', 'display', 'profile']
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
@@ -9,7 +9,6 @@ 
   hgext/fsmonitor/pywatchman/ not using absolute_import
   hgext/fsmonitor/pywatchman/ not using absolute_import
   i18n/ not using absolute_import
-  mercurial/ not using absolute_import
   mercurial/ requires print_function not using absolute_import
   tests/ not using absolute_import