pylab.close() gtk error

Hello,

If I run the following script on my system (SuSE 10.0, matplotlib-0.87 but
same behaviour with 0.86):

#!/usr/bin/python

import matplotlib
import pylab

pylab.figure()
pylab.close()

It crashes with the following error message:

Traceback (most recent call last):
  File "./tmp.py", line 8, in ?
    pylab.close()
  File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 768, in
close
    else: _pylab_helpers.Gcf.destroy(figManager.num)
  File "/usr/lib/python2.4/site-packages/matplotlib/_pylab_helpers.py", line
28, in destroy
    figManager.destroy()
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py",
line 456, in destroy
    gtk.main_quit()
RuntimeError: called outside of a mainloop

Does someone has an idea of the problem?
I didn't have this kind of problem with my SuSE 9.3 and matplotlib-0.85

···

--
Emmanuel Pécontal

CRAL - Observatoire de Lyon
9, Av. Charles Andre
F-69561 Saint Genis Laval Cedex

tel (33) (0)4.78.86.83.76 - fax (33) (0)4.78.86.83.86

email : pecontal@...419...
~