[Zope] thread safety

Jerome Alet alet@unice.fr
Wed, 16 May 2001 16:44:37 +0200 (MET DST)


Hi,

In the ZShell external method I've written, I've got some code which does
the shell globbing for wildcards using the glob.glob module after having
redirected some methods from the os module to my own, e.g. :

--- CUT ---
	oldlistdir = os.listdir
	os.listdir = mylistdir
	...
	glob.glob(...)
	...
	os.listdir = oldlistdir
	...
--- CUT ---

So my question is: is this code thread safe, wrt to other Zope threads
accessing the os module methods while they are redirected to mine ? I
don't want other Zope threads to access my own methods, just the current
one. 

If it is not thread safe, then how can I do it another way ?

Thanks in advance.

Jerome Alet - alet@unice.fr