<div dir="ltr">Thanks, yea that looks like the right fix.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 5, 2015 at 2:10 PM Chaoren Lin <<a href="mailto:chaorenl@google.com">chaorenl@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">rL252218 should hopefully fix it.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 5, 2015 at 1:53 PM, Chaoren Lin <span dir="ltr"><<a href="mailto:chaorenl@google.com" target="_blank">chaorenl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, I think this changed caused all of the OS X tests to fail:<div><br></div><div><a href="http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/6969/steps/test1/logs/stdio" target="_blank">http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/6969/steps/test1/logs/stdio</a><br></div><div><br></div><div>with this error:</div><div><br></div><div><pre style="font-family:'Courier New',courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span style="color:red">Traceback (most recent call last):
File "/Users/lldb_build/lldbSlave/buildDir/scripts/../lldb/test/dotest.py", line 7, in <module>
lldbsuite.test.run_suite()
File "/Users/lldb_build/lldbSlave/buildDir/lldb/packages/Python/lldbsuite/test/dotest.py", line 1487, in run_suite
setupCrashInfoHook()
File "/Users/lldb_build/lldbSlave/buildDir/lldb/packages/Python/lldbsuite/test/dotest.py", line 390, in setupCrashInfoHook
import lock
ImportError: No module named lock</span></pre></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 5, 2015 at 11:22 AM, Zachary Turner via lldb-commits <span dir="ltr"><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: zturner<br>
Date: Thu Nov 5 13:22:28 2015<br>
New Revision: 252191<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=252191&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=252191&view=rev</a><br>
Log:<br>
Python 3 - Turn on absolute imports, and fix existing imports.<br>
<br>
Absolute imports were introduced in Python 2.5 as a feature<br>
(e.g. from __future__ import absolute_import), and made default<br>
in Python 3.<br>
<br>
When absolute imports are enabled, the import system changes in<br>
a couple of ways:<br>
<br>
1) The `import foo` syntax will *only* search sys.path. If `foo`<br>
isn't in sys.path, it won't be found. Period. Without absolute<br>
imports, the import system will also search the same directory<br>
that the importing file resides in, so that you can easily<br>
import from the same folder.<br>
<br>
2) From inside a package, you can use a dot syntax to refer to higher<br>
levels of the current package. For example, if you are in the<br>
package lldbsuite.test.utility, then ..foo refers to<br>
lldbsuite.test.foo. You can use this notation with the<br>
`from X import Y` syntax to write intra-package references. For<br>
example, using the previous locationa s a starting point, writing<br>
`from ..support import seven` would import lldbsuite.support.seven<br>
<br>
Since this is now the default behavior in Python 3, this means that<br>
importing from the same directory with `import foo` *no longer works*.<br>
As a result, the only way to have portable code is to force absolute<br>
imports for all versions of Python.<br>
<br>
See PEP 0328 [<a href="https://www.python.org/dev/peps/pep-0328/" rel="noreferrer" target="_blank">https://www.python.org/dev/peps/pep-0328/</a>] for more<br>
information about absolute and relative imports.<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D14342" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14342</a><br>
Reviewed By: Todd Fiala<br>
<br>
Modified:<br>
lldb/trunk/packages/Python/lldbsuite/test/__init__.py<br>
lldb/trunk/packages/Python/lldbsuite/test/bench.py<br>
lldb/trunk/packages/Python/lldbsuite/test/curses_results.py<br>
lldb/trunk/packages/Python/lldbsuite/test/dosep.py<br>
lldb/trunk/packages/Python/lldbsuite/test/dotest.py<br>
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py<br>
lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py<br>
lldb/trunk/packages/Python/lldbsuite/test/test_categories.py<br>
lldb/trunk/packages/Python/lldbsuite/test/test_results.py<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/__init__.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/__init__.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/__init__.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/__init__.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/__init__.py Thu Nov 5 13:22:28 2015<br>
@@ -1,4 +1,6 @@<br>
# Module level initialization for the `lldbsuite.test` module.<br>
<br>
-import dotest<br>
+from __future__ import absolute_import<br>
+<br>
+from . import dotest<br>
run_suite = dotest.run_suite<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/bench.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/bench.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/bench.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/bench.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/bench.py Thu Nov 5 13:22:28 2015<br>
@@ -15,6 +15,7 @@ See also bench-history.<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
import os, sys<br>
import re<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/curses_results.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/curses_results.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/curses_results.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/curses_results.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/curses_results.py Thu Nov 5 13:22:28 2015<br>
@@ -10,15 +10,21 @@ Configuration options for lldbtest.py se<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
+# System modules<br>
import curses<br>
import datetime<br>
-import lldbcurses<br>
import math<br>
import sys<br>
import test_results<br>
import time<br>
<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+from . import lldbcurses<br>
+<br>
class Curses(test_results.ResultsFormatter):<br>
"""Receives live results from tests that are running and reports them to the terminal in a curses GUI"""<br>
<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Thu Nov 5 13:22:28 2015<br>
@@ -33,8 +33,7 @@ echo core.%p | sudo tee /proc/sys/kernel<br>
"""<br>
<br>
from __future__ import print_function<br>
-<br>
-<br>
+from __future__ import absolute_import<br>
<br>
# system packages and modules<br>
import asyncore<br>
@@ -51,15 +50,17 @@ import threading<br>
<br>
from six.moves import queue<br>
<br>
-# Add our local test_runner/lib dir to the python path.<br>
-sys.path.append(os.path.join(os.path.dirname(__file__), "test_runner", "lib"))<br>
-<br>
# Our packages and modules<br>
-import dotest_channels<br>
-import dotest_args<br>
+import lldbsuite.support.seven as seven<br>
+<br>
+from . import dotest_channels<br>
+from . import dotest_args<br>
+<br>
+# Todo: Convert this folder layout to be relative-import friendly and don't hack up<br>
+# sys.path like this<br>
+sys.path.append(os.path.join(os.path.dirname(__file__), "test_runner", "lib"))<br>
import lldb_utils<br>
import process_control<br>
-import lldbsuite.support.seven as seven<br>
<br>
# Status codes for running command with timeout.<br>
eTimedOut, ePassed, eFailed = 124, 0, 1<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Nov 5 13:22:28 2015<br>
@@ -18,16 +18,14 @@ Type:<br>
for available options.<br>
"""<br>
<br>
+from __future__ import absolute_import<br>
from __future__ import print_function<br>
-import sys<br>
-<br>
-import lldbsuite<br>
-import lldbtest_config<br>
<br>
+# System modules<br>
+import sys<br>
import atexit<br>
import importlib<br>
import os<br>
-import dotest_args<br>
import errno<br>
import platform<br>
import progress<br>
@@ -35,14 +33,20 @@ import signal<br>
import socket<br>
import subprocess<br>
import sys<br>
-import test_results<br>
-from test_results import EventBuilder<br>
import inspect<br>
-import unittest2<br>
-import test_categories<br>
<br>
+# Third-party modules<br>
import six<br>
-import lldbsuite.support.seven as seven<br>
+import unittest2<br>
+<br>
+# LLDB Modules<br>
+import lldbsuite<br>
+from . import dotest_args<br>
+from . import lldbtest_config<br>
+from . import test_categories<br>
+from . import test_results<br>
+from .test_results import EventBuilder<br>
+from ..support import seven<br>
<br>
def is_exe(fpath):<br>
"""Returns true if fpath is an executable."""<br>
@@ -1470,7 +1474,7 @@ def run_suite():<br>
# If we are running as the multiprocess test runner, kick off the<br>
# multiprocess test runner here.<br>
if isMultiprocessTestRunner():<br>
- import dosep<br>
+ from . import dosep<br>
dosep.main(output_on_success, num_threads, multiprocess_test_subdir,<br>
test_runner_name, results_formatter_object)<br>
raise Exception("should never get here")<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Nov 5 13:22:28 2015<br>
@@ -1,11 +1,17 @@<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
+# System modules<br>
import argparse<br>
import sys<br>
import multiprocessing<br>
import os<br>
import textwrap<br>
<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+<br>
class ArgParseNamespace(object):<br>
pass<br>
<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py Thu Nov 5 13:22:28 2015<br>
@@ -15,14 +15,18 @@ framework.<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
<br>
-<br>
+# System modules<br>
import asyncore<br>
import socket<br>
<br>
+# Third-party modules<br>
from six.moves import cPickle<br>
<br>
+# LLDB modules<br>
+<br>
class UnpicklingForwardingReaderChannel(asyncore.dispatcher):<br>
"""Provides an unpickling, forwarding asyncore dispatch channel reader.<br>
<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py Thu Nov 5 13:22:28 2015<br>
@@ -13,12 +13,18 @@ Provides helper support for adding lldb<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
+# System modules<br>
import os<br>
import platform<br>
import subprocess<br>
import sys<br>
<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+<br>
<br>
def add_lldb_test_paths(check_dir):<br>
# pylint: disable=line-too-long<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py Thu Nov 5 13:22:28 2015<br>
@@ -1,6 +1,12 @@<br>
+from __future__ import absolute_import<br>
+<br>
+# System modules<br>
import time<br>
-#import numpy<br>
-from lldbtest import *<br>
+<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+from .lldbtest import *<br>
<br>
class Stopwatch(object):<br>
"""Stopwatch provides a simple utility to start/stop your stopwatch multiple<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py Thu Nov 5 13:22:28 2015<br>
@@ -1,10 +1,16 @@<br>
+from __future__ import absolute_import<br>
<br>
-<br>
-import curses, curses.panel<br>
+# System modules<br>
+import curses<br>
+import curses.panel<br>
import sys<br>
-import six<br>
import time<br>
<br>
+# Third-party modules<br>
+import six<br>
+<br>
+# LLDB modules<br>
+<br>
class Point(object):<br>
def __init__(self, x, y):<br>
self.x = x<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py Thu Nov 5 13:22:28 2015<br>
@@ -1,11 +1,17 @@<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
-import lldb<br>
-from lldbtest import *<br>
-import lldbutil<br>
+# System modules<br>
import os<br>
import sys<br>
<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+import lldb<br>
+from .lldbtest import *<br>
+from . import lldbutil<br>
+<br>
def source_type(filename):<br>
_, extension = os.path.splitext(filename)<br>
return {<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py Thu Nov 5 13:22:28 2015<br>
@@ -1,14 +1,18 @@<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
-<br>
-<br>
-import lldb<br>
-from lldbtest import *<br>
-import lldbutil<br>
+# System modules<br>
import os<br>
import sys<br>
+<br>
+# Third-party modules<br>
import pexpect<br>
<br>
+# LLDB Modules<br>
+import lldb<br>
+from .lldbtest import *<br>
+from . import lldbutil<br>
+<br>
class PExpectTest(TestBase):<br>
<br>
mydir = TestBase.compute_mydir(__file__)<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py Thu Nov 5 13:22:28 2015<br>
@@ -1,6 +1,14 @@<br>
""" This module contains functions used by the test cases to hide the<br>
architecture and/or the platform dependent nature of the tests. """<br>
<br>
+from __future__ import absolute_import<br>
+<br>
+# System modules<br>
+<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+<br>
def check_first_register_readable(test_case):<br>
if test_case.getArchitecture() in ['x86_64', 'i386']:<br>
test_case.expect("register read eax", substrs = ['eax = 0x'])<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Nov 5 13:22:28 2015<br>
@@ -32,10 +32,11 @@ $<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
-<br>
-<br>
+# System modules<br>
import abc<br>
+import collections<br>
import gc<br>
import glob<br>
import os, sys, traceback<br>
@@ -45,17 +46,19 @@ import signal<br>
from subprocess import *<br>
import time<br>
import types<br>
-import unittest2<br>
-import lldb<br>
-import lldbtest_config<br>
-import lldbutil<br>
-import test_categories<br>
<br>
+# Third-party modules<br>
+import unittest2<br>
from six import add_metaclass<br>
from six import StringIO as SixStringIO<br>
from six.moves.urllib import parse as urlparse<br>
import six<br>
-import collections<br>
+<br>
+# LLDB modules<br>
+import lldb<br>
+from . import lldbtest_config<br>
+from . import lldbutil<br>
+from . import test_categories<br>
<br>
# dosep.py starts lots and lots of dotest instances<br>
# This option helps you find if two (or more) dotest instances are using the same<br>
@@ -1890,7 +1893,7 @@ class Base(unittest2.TestCase):<br>
""" Returns a string that represents the compiler version.<br>
Supports: llvm, clang.<br>
"""<br>
- from lldbutil import which<br>
+ from .lldbutil import which<br>
version = 'unknown'<br>
<br>
compiler = self.getCompilerBinary()<br>
@@ -2546,7 +2549,7 @@ class TestBase(Base):<br>
Run the 'thread list' command, and select the thread with stop reason as<br>
'stop_reason'. If no such thread exists, no select action is done.<br>
"""<br>
- from lldbutil import stop_reason_to_str<br>
+ from .lldbutil import stop_reason_to_str<br>
self.runCmd('thread list')<br>
output = self.res.GetOutput()<br>
thread_line_pattern = re.compile("^[ *] thread #([0-9]+):.*stop reason = %s" %<br>
@@ -2801,7 +2804,7 @@ class TestBase(Base):<br>
<br>
def DebugSBValue(self, val):<br>
"""Debug print a SBValue object, if traceAlways is True."""<br>
- from lldbutil import value_type_to_str<br>
+ from .lldbutil import value_type_to_str<br>
<br>
if not traceAlways:<br>
return<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Thu Nov 5 13:22:28 2015<br>
@@ -5,16 +5,21 @@ They can also be useful for general purp<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
-<br>
-<br>
-import lldb<br>
-import os, sys<br>
+# System modules<br>
+import collections<br>
+import os<br>
import re<br>
+import sys<br>
<br>
+# Third-party modules<br>
from six import StringIO as SixStringIO<br>
import six<br>
-import collections<br>
+<br>
+# LLDB modules<br>
+import lldb<br>
+<br>
<br>
# ===================================================<br>
# Utilities for locating/checking executable programs<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Thu Nov 5 13:22:28 2015<br>
@@ -2,8 +2,15 @@<br>
Provides definitions for various lldb test categories<br>
"""<br>
<br>
+from __future__ import absolute_import<br>
+<br>
+# System modules<br>
import sys<br>
<br>
+# Third-party modules<br>
+<br>
+# LLDB modules<br>
+<br>
all_categories = {<br>
'dataformatters': 'Tests related to the type command and the data formatters subsystem',<br>
'expression' : 'Tests related to the expression parser',<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/test_results.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_results.py?rev=252191&r1=252190&r2=252191&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_results.py?rev=252191&r1=252190&r2=252191&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/test_results.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/test_results.py Thu Nov 5 13:22:28 2015<br>
@@ -9,9 +9,9 @@ within the LLDB test suite.<br>
"""<br>
<br>
from __future__ import print_function<br>
+from __future__ import absolute_import<br>
<br>
-<br>
-<br>
+# System modules<br>
import argparse<br>
import inspect<br>
import os<br>
@@ -23,9 +23,11 @@ import time<br>
import traceback<br>
import xml.sax.saxutils<br>
<br>
+# Third-party modules<br>
import six<br>
from six.moves import cPickle<br>
<br>
+# LLDB modules<br>
<br>
class EventBuilder(object):<br>
"""Helper class to build test result event dictionaries."""<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div>