From 68f9cdd884da1c0b47c1ebf9422cae78faf0e1b2 Mon Sep 17 00:00:00 2001 From: Laurens Van Houtven <_@lvh.cc> Date: Thu, 20 Jun 2013 20:08:36 +0200 Subject: [PATCH] Pick find_module implementation statically --- jedi/_compatibility.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 6a411b0b..72d6a4d1 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -56,18 +56,16 @@ def find_module_pre_py33(string, path=None): return (mod_info[0], mod_info[1], mod_info[2][2] == imp.PKG_DIRECTORY) -def find_module(string, path=None): - """Provides information about a module. +find_module = find_module_py33 if is_py33 else find_module_pre_py33 +find_module.__doc__ = """ +Provides information about a module. - This function isolates the differences in importing libraries introduced with - python 3.3 on; it gets a module name and optionally a path. It will return a - tuple containin an open file for the module (if not builtin), the filename - or the name of the module if it is a builtin one and a boolean indicating - if the module is contained in a package.""" - if is_py33: - return find_module_py33(string, path) - else: - return find_module_pre_py33(string, path) +This function isolates the differences in importing libraries introduced with +python 3.3 on; it gets a module name and optionally a path. It will return a +tuple containin an open file for the module (if not builtin), the filename +or the name of the module if it is a builtin one and a boolean indicating +if the module is contained in a package. +""" # next was defined in python 2.6, in python 3 obj.next won't be possible # anymore