Python API problem with open USB devices

We’re writing a function that will poll for new devices with the Python Bindings for FrontPanel.

Basically, our function will query the device count on a given interval and notify another thread when new serial numbers become available. Here is a simple loop that exposes a problem we’re seeing on Linux:

while True:
xem=ok.FrontPanel()
deviceCount=xem.GetDeviceCount()
print “%d Devices” % deviceCount
time.sleep(.5)

do other stuff based on devices present

On Linux (Fedora Core 8), we’re getting this output:
1 Devices
1 Devices
1 Devices
1 Devices
1 Devices
1 Devices
could not open device file(/dev/bus/usb/007/001): Too many open filescould not open bus path(/dev/bus/usb/006): Too many open files

The same basic program works on Mac without the open files error. Is there something in the API we’re missing?

Thanks for any input.