File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11"""rope, a python refactoring library"""
22
33INFO = __doc__
4- VERSION = '0.9.3 '
4+ VERSION = '0.9.4 '
55COPYRIGHT = """\
6- Copyright (C) 2006-2010 Ali Gholami Rudi
7- Copyright (C) 2009-2010 Anton Gritsay
6+ Copyright (C) 2006-2012 Ali Gholami Rudi
7+ Copyright (C) 2009-2012 Anton Gritsay
88
99This program is free software; you can redistribute it and/or modify it
1010under the terms of GNU General Public License as published by the
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ def relative(root, path):
3333 root = rope .base .project ._realpath (root ).replace (os .path .sep , '/' )
3434 path = rope .base .project ._realpath (path ).replace (os .path .sep , '/' )
3535 if path == root :
36- return ''
36+ return ''
3737 if path .startswith (root + '/' ):
38- return path [len (root ) + 1 :]
38+ return path [len (root ) + 1 :]
3939
4040def report_change (project , path , old_content ):
4141 """Report that the contents of file at `path` was changed
Original file line number Diff line number Diff line change @@ -75,12 +75,13 @@ def is_python_file(self, resource):
7575
7676 def get_module (self , name , folder = None ):
7777 """Returns a `PyObject` if the module was found."""
78+ # check if this is a builtin module
79+ pymod = self ._builtin_module (name )
80+ if pymod is not None :
81+ return pymod
7882 module = self .find_module (name , folder )
7983 if module is None :
80- module = self ._builtin_module (name )
81- if module is None :
82- raise ModuleNotFoundError ('Module %s not found' % name )
83- return module
84+ raise ModuleNotFoundError ('Module %s not found' % name )
8485 return self .resource_to_pyobject (module )
8586
8687 def _builtin_submodules (self , modname ):
You can’t perform that action at this time.
0 commit comments