Import no longer works in Python 2.3.x

Matt Whiteley matt at cynetix.co.uk
Wed Feb 11 15:18:43 EST 2004


I have some python code in a directory called customModules and this sits
under the main directory which contains a piece of server.py code. Under
2.1.x and 2.2.x, I did the following in server.py :

import time, sys
sys.path += ['./customModules']

from requestHandler import inputHandler

and that allowed me to reference the requestHandler (stored in the
customModules directory) code without having to use
customModules.requestHandler every time. Under 2.3.x this doesn't work
anymore and I get a "ImportError: cannot import name inputHandler" error.
Can anyone shed some light on why this is and how I can get around it
please.

Code that demonstrates this exact problem is at
http://mss.cynetix.co.uk/download.htm - running server.py will work fine
under 2.2 but not under 2.3.

Many thanks
Matt Whiteley





More information about the Python-list mailing list