Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: tools/idl_parser/idl_lexer.py

Issue 2708803003: idl_parser: Always use PLY from third_party. (Closed)
Patch Set: Use sys.path.insert() Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/idl_parser/idl_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/idl_parser/idl_lexer.py
diff --git a/tools/idl_parser/idl_lexer.py b/tools/idl_parser/idl_lexer.py
index 1f186d722d9e5921061d1862b604b3cfef4da907..a5fc49c3e251aa91de2678721342168e95f5235b 100755
--- a/tools/idl_parser/idl_lexer.py
+++ b/tools/idl_parser/idl_lexer.py
@@ -17,20 +17,10 @@ PLY can be found at:
import os.path
import sys
-#
-# Try to load the ply module, if not, then assume it is in the third_party
-# directory.
-#
-try:
- # Disable lint check which fails to find the ply module.
- # pylint: disable=F0401
- from ply import lex
-except ImportError:
- module_path, module_name = os.path.split(__file__)
- third_party = os.path.join(module_path, '..', '..', 'third_party')
- sys.path.append(third_party)
- # pylint: disable=F0401
- from ply import lex
+SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
+sys.path.insert(0, os.path.join(SRC_DIR, 'third_party'))
+from ply import lex
+
#
# IDL Lexer
« no previous file with comments | « no previous file | tools/idl_parser/idl_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698