Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a Thread not be daemonized in python3.2?

I am running a script in python-3.2 on a Raspberry Pi 2 Model B

The thread looks like this:

myThread = threading.Thread(target=someFunction, args=(arg1,arg2,arg3),
           daemon=True)
myThread.start()

Everytime this thread gets called. this error gets triggered:

TypeError: __init__() got an unexpected keyword argument 'daemon'

I know that there is not Python-3.4 stable version for the Debian Wheezy Version 7.10 hence I have to work around with python 3.2

Ironically, the Python 3.2 Documentation does state that daemon is a boolean available.

What is this glitch and how can I solve this?

like image 333
Shan-Desai Avatar asked Mar 11 '23 21:03

Shan-Desai


1 Answers

The daemon argument was added in version 3.3, see. Setting the flag in prior versions works like this:

myThread = threading.Thread(target=someFunction, args=(arg1,arg2,arg3))
myThread.daemon = True
myThread.start()
like image 173
miindlek Avatar answered Mar 19 '23 06:03

miindlek