From 65a2688be9175de2beae9bca833f501e8a683b59 Mon Sep 17 00:00:00 2001 From: Benjamin Attal Date: Sat, 31 May 2014 23:42:44 -0400 Subject: [PATCH] Adjust test for new language dict. --- bitshift/parser/__init__.py | 3 ++- test/parser_test.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bitshift/parser/__init__.py b/bitshift/parser/__init__.py index 79fca78..927b397 100644 --- a/bitshift/parser/__init__.py +++ b/bitshift/parser/__init__.py @@ -27,11 +27,12 @@ def _lang(codelet): try: if codelet.filename: - lex = pgl.guess_lexer_for_filename(codelet.filename, codelet.code) + lex = pgl.get_lexer_for_filename(codelet.filename) else: lex = pgl.guess_lexer(codelet.code) except util.ClassNotFound: raise UnsupportedFileError(codelet.filename) + return LANGS.index(lex.name) def _recv_data(server_socket): diff --git a/test/parser_test.py b/test/parser_test.py index a1cfad3..ffee75c 100644 --- a/test/parser_test.py +++ b/test/parser_test.py @@ -21,7 +21,7 @@ if __name__ == '__main__': elif sys.argv[1] == 'ruby': file_name = "resources/parser.rb" - server_socket_number = 5003 + server_socket_number = 5065 server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.connect(("localhost", server_socket_number))