[Zope3-checkins] CVS: Zope3/utilities - finddeps.py:1.17
Fred L. Drake, Jr.
fred at zope.com
Wed Apr 7 13:47:36 EDT 2004
Update of /cvs-repository/Zope3/utilities
In directory cvs.zope.org:/tmp/cvs-serv30557
Modified Files:
finddeps.py
Log Message:
- ImportFinder.transition() should always ignore comments; this could
accumulate comment text into the saved name in some cases
- add useful information to some assertion messages
=== Zope3/utilities/finddeps.py 1.16 => 1.17 ===
--- Zope3/utilities/finddeps.py:1.16 Wed Apr 7 13:27:14 2004
+++ Zope3/utilities/finddeps.py Wed Apr 7 13:47:36 2004
@@ -181,6 +181,8 @@
self.module_checks[name] = name in sys.modules
def transition(self, type, string, lineno):
+ if type == tokenize.COMMENT:
+ return
entry = self.state_table.get((self.state, (type, string)))
if entry is not None:
self.state = entry[0]
@@ -248,7 +250,7 @@
def action_save(self, type, string, lineno):
if self.name:
- assert not self.name.endswith(".")
+ assert not self.name.endswith("."), repr(self.name)
name = self.name
if self.prefix:
name = "%s.%s" % (self.prefix, name)
@@ -256,8 +258,8 @@
self.name = ""
def action_setprefix(self, type, string, lineno):
- assert self.name
- assert not self.name.endswith(".")
+ assert self.name, repr(self.name)
+ assert not self.name.endswith("."), repr(self.name)
self.prefix = self.name
self.name = ""
More information about the Zope3-Checkins
mailing list