# HG changeset patch # User Gregory Szorc # Date 1478051730 25200 # Node ID 2ed0b3f9f79e237ce4c130d6091a31574ac0206c # Parent f42cd5434cc20f06a0595efeede1c09dcd8a9694 statprof: use absolute_imports As part of this, we modify import order to satisfy our import checker. diff -r f42cd5434cc2 -r 2ed0b3f9f79e mercurial/statprof.py --- a/mercurial/statprof.py Sun Aug 14 19:14:05 2016 -0700 +++ b/mercurial/statprof.py Tue Nov 01 18:55:30 2016 -0700 @@ -102,12 +102,22 @@ 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 -r f42cd5434cc2 -r 2ed0b3f9f79e tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t Sun Aug 14 19:14:05 2016 -0700 +++ b/tests/test-check-py3-compat.t Tue Nov 01 18:55:30 2016 -0700 @@ -9,7 +9,6 @@ hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import hgext/fsmonitor/pywatchman/pybser.py not using absolute_import i18n/check-translation.py not using absolute_import - mercurial/statprof.py not using absolute_import mercurial/statprof.py requires print_function setup.py not using absolute_import tests/test-demandimport.py not using absolute_import