closing windows matplotlib and tkinter

I have a simple window to open a file that the data is then used to make a graph:
The code for that part is:
window = Tkinter.Tk()
    #window.withdraw() <-- not sure what this does
    window.title('hello world')
    w = Tkinter.Label(window,text="hello, again")
    menubar = Tkinter.Menu(window)
    mfile = Tkinter.Menu(menubar, tearoff = 0)
    mfile.add_command(label="Open", command=callback)
    mfile.add_command(label="Save", command=callback)
    menubar.add_cascade(label="File", menu=mfile)
    errmsg = 'Error!'

    of_But = Tkinter.Button(window, text= "Open File", command=callback)
    #Button(text='Quit', command=(lambda: showerror('Sure you want to quit?', errmsg))).pack(fill=X)
    q = Tkinter.Button(window, text="Quit", fg="red", command=window.quit)



I then create a map :
        m1 = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
        shp_info = m1.readshapefile(r'C:\Python25\Lib\basemap-\examples\citiesx020','states',drawbounds=True)

        for seq, shapedict in enumerate(m1.states_info):
            if int(shapedict['POP_2000'])>150000:

But when I click on quit, I get this error:

Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

It's not that big of a deal since I'm quitting anyways, but does anyone know how to fix this?