Commit Graph

15 Commits

Author SHA1 Message Date
Thomas Heller 1fac5a4505 Fixed a modulefinder crash on certain relative imports. 2008-10-30 20:18:13 +00:00
Brett Cannon 9bd059ff4e Silence warnings under -3 about using dict.has_key() for modulefinder. 2008-08-04 00:27:29 +00:00
Christian Heimes c756d00cf2 Replaced import of the 'new' module with 'types' module and added a deprecation warning to the 'new' module. 2007-11-27 21:34:01 +00:00
Thomas Heller 112d1a64ac Modulefinder now handles absolute and relative imports, including
tests.

Will backport to release25-maint.
2006-10-27 19:05:53 +00:00
Thomas Heller 2e7c8328ae Fix SF item #876278: Unbounded recursion in modulefinder.
Already backported to release23-maint.
2004-05-11 15:10:59 +00:00
Neil Schemenauer 32d23c9264 Fix typo. 2004-02-15 16:43:20 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Thomas Heller aaf1c8dc9e SF #841977 - modulefinder fails to find extension modules in packages
The find_all_submodules() method in modulefinder only
looks for *.py, *.pyc, and *.pyo files.  Python
extension modules are only found if they are referenced
in import statements somewhere.

This patch uses the actual list from imp.get_suffixes().

Backported myself.
2003-11-14 10:28:42 +00:00
Just van Rossum a920a8895e up the b/w compatibility requirement to 2.2 2003-07-18 15:31:40 +00:00
Just van Rossum f0dfbaf4ef Patch #698082 from Thomas Heller: Modulefinder didn't exclude modules
in packages correctly.
2003-03-05 17:23:48 +00:00
Guido van Rossum 68468eba63 Get rid of many apply() calls. 2003-02-27 20:14:51 +00:00
Just van Rossum a212c5c37f removed bizarre construct, no idea why it was there... 2003-02-01 10:29:45 +00:00
Tim Peters 2c60f7a136 Whitespace normalization. 2003-01-29 03:49:43 +00:00
Just van Rossum e29310a2b3 patch attached to sf item #643711:
any_missing() returns less bogus missing modules.

- I've rewritten scan_code() more or less from scratch,
factored bits and pieces out for readability.
- keep track of global assignments and failed imports per
module; use this to determine whether the Y in "from X
import Y" is a submodule or just a global name. This is not
100% doable: you can't tell which symbols are imported when
doing a star import of a non-Python module short of actually
importing it.
- added a new method to ModuleFinder: any_missing_maybe(),
which returns *two* lists, one with certain misses, one with
possible misses. The possible misses are *very* often false
alarms, so it's useful to keep this list separate.
any_misses() now simply returns the union of
any_missing_maybe().

TODO: documentation, test_modulefinder.py
2002-12-31 16:33:00 +00:00
Just van Rossum 41c554fbec moving modulefinder.py to the standard library 2002-12-31 16:27:33 +00:00