By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

TypeError: 'NoneType' object is not callable

P: n/a
Hello,
I am using Python 2.3.2 with a C++ extention DLL in
muti-threaded environment.

1. For each new thread I create a separate
sub-interpreter.
2. Each thread executes multiple python statements
calling the class objects in my extention DLL.
3. Before each execution I import my extention module
using;
import myModule
4. I destoy each sub-interpreter at the end of that
particular thread.
5. Python initialization and finalization happens in
the main thread.

I am observing that;
As explained above when multiple threads are running.
And as one of these threads finishes, in other running
threads I start getting "TypeError: 'NoneType' object
is not callable" error on the methods called on class
objects in extention module.

Does anyone know why this might be happening ? Is
there any specific way I should be using Python and
Extention modules in multi-threaded environment ?

Any help is appreciated !!!
Thanks,
Atul Kshirsagar

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <ma************************************@python.org >,
Atul Kshirsagar <at************@yahoo.com> wrote:
I am observing that;
As explained above when multiple threads are running.
And as one of these threads finishes, in other running
threads I start getting "TypeError: 'NoneType' object
is not callable" error on the methods called on class
objects in extention module.
Does anyone know why this might be happening ? Is
there any specific way I should be using Python and
Extention modules in multi-threaded environment ?
Any help is appreciated !!!


I'm guessing here. My test gets a different error
message:
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import types
types.NoneType <type 'NoneType'> n = types.NoneType()

Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: cannot create 'NoneType' instances
The object None is intended to be unique, so it would
make sense if programs were forbidden from making more
instances of NoneType.

Whatever route you've taken to get a reference to
types.NoneType which you then call is probably a mistake.

Good Luck. Mel.
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.