472,784 Members | 953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,784 software developers and data experts.

TypeError: 'NoneType' object is not callable

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
1 12961
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: ‘5ÛHH575-UAZWKVVP-7H2H48V3 | last post by:
(see end of message for example code) When an instance has a dynamically assigned instance method, deepcopy throws a TypeError with the message "TypeError: instancemethod expected at least 2...
1
by: homepricemaps | last post by:
if i do the following i get the url of an image i am looking for image = "" image = bs.img print image however if i do this out.write (image ) i get an error that says "nonetype error is...
5
by: Randall Parker | last post by:
Using Python 2.4.2 on Windows 2000 in SPE. Getting: TypeError: 'str' object is not callable on this line: TmpErrMsg1 = "State machine %s " (StateMachineName) In Winpdb 1.0.6 the...
1
by: Gary Wessle | last post by:
dear python users I am not sure why I am getting **************************************************************** Traceback (most recent call last): File "my.py", line 3, in ?...
9
by: thompson.marisa | last post by:
Hi. I'm extremely new to Python and programming as a whole. I have written a python script with the assistance of ESRI ArcGIS 9.2, which uses Python 2.4.1, however, it gives me this error when...
2
by: AWasilenko | last post by:
I'm trying to test a few different approaches to displaying pages via Cherrypy and I'm not having much luck. Here is my code so far: import sys, cherrypy, html class Root: @cherrypy.expose...
33
by: christophertidy | last post by:
Hi I am new to Python and have recieved this error message when trying to instantiate an object from a class from another file within the same directory and wondered what I have done wrong. I...
2
by: Jordan Harry | last post by:
I'm trying to write a simple program to calculate permutations. I created a file called "mod.py" and put the following in it: def factorial(n): a = n b = n while a>0 and b>1: n = (n)*(b-1)...
6
by: ssecorp | last post by:
Im looking into PvsNP: http://www.claymath.org/millennium/P_vs_NP/ so I thought I'd write the program just to get a feel for it. But I run into a problem. Why does it all the sudden return...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.