关闭窗口时,Python 3.6 RecursionError(使用街机库)

时间:2018-09-30 12:46:50

标签: python recursion window

我正在尝试学习如何将“ arcade”库用于python。 我运行以下代码从我的代码打开一个窗口:

    import arcade

    arcade.open_window(self.__screen_width, self.__screen_height, "Snake Game")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.run()

一切似乎都很好,但是,当我手动关闭窗口(按“ x”按钮)时,出现以下错误:

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 234, in 'calling callback function'
File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1121, in objc_method
result = f(py_self, *args)
File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/window/cocoa/pyglet_window.py", line 25, in nextEventMatchingMask_untilDate_inMode_dequeue_
if self.inLiveResize():
File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 785, in __call__
return self.method(self.objc_id, *args)
File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 753, in __call__
f = self.get_callable()
RecursionError: maximum recursion depth exceeded

非常感谢您的帮助。如果有人能告诉我为什么会这样,我将不胜感激。

0 个答案:

没有答案