From 18a31dcbf1fcad2e6e375d1417beee45a5c27aeb Mon Sep 17 00:00:00 2001 From: ColinDuquesnoy Date: Tue, 18 Feb 2014 19:00:35 +0100 Subject: [PATCH] Fix read mode for pyc files Now all test should pass on travis. --- jedi/_compatibility.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index fa42abb1..423c6374 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -31,7 +31,8 @@ def find_module_py33(string, path=None): module_file = None else: module_path = loader.get_filename(string) - module_file = open(module_path) + mode = 'rb' if module_path.endswith(".pyc") else 'r' + module_file = open(module_path, mode) except AttributeError: # ExtensionLoader has not attribute get_filename, instead it has a # path attribute that we can use to retrieve the module path