changeset 5639:7dd5cf9d1e09

demandload: give better diagnostic for call of an unloaded module
author Matt Mackall <mpm@selenic.com>
date Mon, 10 Dec 2007 10:24:47 -0600
parents a9b7e425674f
children 04c76f296ad6
files mercurial/demandimport.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/demandimport.py	Mon Dec 10 10:24:36 2007 -0600
+++ b/mercurial/demandimport.py	Mon Dec 10 10:24:47 2007 -0600
@@ -67,7 +67,7 @@
             return "<proxied module '%s'>" % self._data[0]
         return "<unloaded module '%s'>" % self._data[0]
     def __call__(self, *args, **kwargs):
-        raise TypeError("'unloaded module' object is not callable")
+        raise TypeError("%s object is not callable" % repr(self))
     def __getattribute__(self, attr):
         if attr in ('_data', '_extend', '_load', '_module'):
             return object.__getattribute__(self, attr)