hanchenye-llvm-project/lldb
Zachary Turner c1b7cd72db Python 3 - Turn on absolute imports, and fix existing imports.
Absolute imports were introduced in Python 2.5 as a feature
(e.g. from __future__ import absolute_import), and made default
in Python 3.

When absolute imports are enabled, the import system changes in
a couple of ways:

1) The `import foo` syntax will *only* search sys.path.  If `foo`
   isn't in sys.path, it won't be found.  Period.  Without absolute
   imports, the import system will also search the same directory
   that the importing file resides in, so that you can easily
   import from the same folder.

2) From inside a package, you can use a dot syntax to refer to higher
   levels of the current package.  For example, if you are in the
   package lldbsuite.test.utility, then ..foo refers to
   lldbsuite.test.foo.  You can use this notation with the
   `from X import Y` syntax to write intra-package references.  For
   example, using the previous locationa s a starting point, writing
   `from ..support import seven` would import lldbsuite.support.seven

Since this is now the default behavior in Python 3, this means that
importing from the same directory with `import foo` *no longer works*.
As a result, the only way to have portable code is to force absolute
imports for all versions of Python.

See PEP 0328 [https://www.python.org/dev/peps/pep-0328/] for more
information about absolute and relative imports.

Differential Revision: http://reviews.llvm.org/D14342
Reviewed By: Todd Fiala

llvm-svn: 252191
2015-11-05 19:22:28 +00:00
..
cmake Add go data formatters. 2015-11-05 00:24:36 +00:00
docs Have debugserver send the OS version string plus 2015-08-12 03:27:33 +00:00
examples Python 3 - modernize exception catching syntax. 2015-11-03 19:49:05 +00:00
include Add a comment explaining TypeImpl. 2015-11-05 19:20:39 +00:00
lib Add initial gmake glue for the NetBSD platform 2015-10-24 01:28:24 +00:00
lit Create a check-lldb-unit target to run unit tests. 2015-03-13 20:55:07 +00:00
lldb.xcodeproj Teach LLDB how to directly launch processes on the iOS simulator 2015-11-05 00:46:25 +00:00
lldb.xcworkspace Working on getting the OSX build green 2015-05-12 02:20:27 +00:00
packages/Python/lldbsuite Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
resources Only export public symbols with the cmake build. 2015-09-04 00:00:41 +00:00
scripts Don't access class members inside of `__del__`. 2015-11-04 23:03:10 +00:00
source Fix build on platforms that don't have dlfcn.h 2015-11-05 19:22:06 +00:00
test Move go expression tests to the new location. 2015-11-02 21:28:18 +00:00
third_party/Python/module Python 3 - Fix usage of `unicode` in unittest2. 2015-11-05 19:21:56 +00:00
tools Squelch a silly warning regarding an extra 'default' in 'case' 2015-11-03 21:29:52 +00:00
unittests Fix build for go parser unittest. 2015-11-03 22:46:37 +00:00
utils Python 3: Modernize exception raising syntax. 2015-11-03 21:01:45 +00:00
www Add a sketched out section on adding Language and LanguageRuntime plugins for language support 2015-11-02 22:26:55 +00:00
.arcconfig
.clang-format Create an expression parser for Go. 2015-11-02 19:30:40 +00:00
.gitignore Fix .gitignore to ignore symlinks. 2015-03-31 00:03:00 +00:00
CMakeLists.txt Fixup lldb-argdumper cmake build 2015-10-29 14:14:24 +00:00
CODE_OWNERS.txt Convert CRLF to LF in CODE_OWNERS.txt 2015-03-23 14:00:54 +00:00
INSTALL.txt Revert the patch to Test Commit Access 2015-07-06 11:26:51 +00:00
LICENSE.TXT
Makefile Test commit 2015-07-22 08:41:18 +00:00
lldb.root Introduce a mechanism for reusing Python modules out of tree. 2015-10-20 21:05:57 +00:00
use_lldb_suite_root.py Preparation for turning lldbsuite into a Python package. 2015-10-27 22:33:47 +00:00