imported method from module evaluates to None in some cases

Hrvoje Niksic hniksic at xemacs.org
Thu Nov 20 14:53:08 CET 2008


Andrew <andrewpadilla1 at gmail.com> writes:

> I'm having a problem in some zope (2.10) code (HTTPResponse.py) where
> a method that gets imported somehow evaluates to None in certain cases
> which causes a TypeError exception to be raised (eg: TypeError:
> 'NoneType' object is not callable). The code excerpt is below where
> the exception is raised on the line with the comment 'TypeError IS
> RAISED HERE'.

Could the "certain cases" involve automatic invocation of the close
method at interpreter shutdown?  While the interpreter shuts down,
module-level variables are set to None.  This is documented in some
detail in http://www.python.org/doc/essays/cleanup/, steps C1-C3.



More information about the Python-list mailing list