Index: tools/idl_parser/idl_parser.py |
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py |
index b1e74c7a5a82f60ea982561d06090e312a3972f8..99ef4e5a4c77cdb63b4d4ad3dd96b93b1a3fee7f 100755 |
--- a/tools/idl_parser/idl_parser.py |
+++ b/tools/idl_parser/idl_parser.py |
@@ -36,22 +36,11 @@ import time |
from idl_lexer import IDLLexer |
from idl_node import IDLAttribute, IDLNode |
-# |
-# 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 |
- from ply import yacc |
-except ImportError: |
- module_path, module_name = os.path.split(__file__) |
- third_party = os.path.join(module_path, os.par, os.par, 'third_party') |
- sys.path.append(third_party) |
- # pylint: disable=F0401 |
- from ply import lex |
- from ply import yacc |
+SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir) |
+sys.path = [os.path.join(SRC_DIR, 'third_party')] + sys.path |
+from ply import lex |
+from ply import yacc |
+ |
# |
# ERROR_REMAP |