[SQL-CVS] r592 - trunk/SQLObject/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-02-10 04:49:24
|
Author: ianb Date: 2005-02-10 04:49:16 +0000 (Thu, 10 Feb 2005) New Revision: 592 Modified: trunk/SQLObject/sqlobject/classregistry.py Log: Be careful about sys.modules when generating an error (py.test doesn't put modules in sys.modules) Modified: trunk/SQLObject/sqlobject/classregistry.py =================================================================== --- trunk/SQLObject/sqlobject/classregistry.py 2005-02-09 13:16:59 UTC (rev 591) +++ trunk/SQLObject/sqlobject/classregistry.py 2005-02-10 04:49:16 UTC (rev 592) @@ -74,9 +74,11 @@ "%r, from the module %s in %s)" % (cls.__name__, other, other.__module__, - sys.modules[other.__module__].__file__, + getattr(sys.modules.get(other.__module__), + '__file__', '(unknown)'), cls, cls.__module__, - sys.modules[cls.__module__].__file__)) + getattr(sys.modules.get(cls.__module__), + '__file__', '(unknown)'))) self.classes[cls.__name__] = cls if self.callbacks.has_key(cls.__name__): for callback, args, kw in self.callbacks[cls.__name__]: |