Make sure the monkey patching stuff gevent requires is imported at start, so we dont get an exception on close time
This commit is contained in:
parent
2bc9ff5ca4
commit
59a9a06952
1 changed files with 5 additions and 5 deletions
10
vloed.py
10
vloed.py
|
|
@ -8,6 +8,11 @@ code from https://github.com/defnull/pixelflut/
|
||||||
__version__ = 0.3
|
__version__ = 0.3
|
||||||
__author__ = "Jan Klopper <jan@underdark.nl>"
|
__author__ = "Jan Klopper <jan@underdark.nl>"
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# avoid nasty eception on python closing time
|
||||||
|
from gevent import spawn, monkey
|
||||||
|
monkey.patch_all()
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
import socket
|
import socket
|
||||||
|
|
@ -301,11 +306,6 @@ def RunServer(options):
|
||||||
options=options).serve_forever()
|
options=options).serve_forever()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# import gevent monkeypatching and perform patch_all before anything else to
|
|
||||||
# avoid nasty eception on python closing time
|
|
||||||
from gevent import spawn, monkey
|
|
||||||
monkey.patch_all()
|
|
||||||
|
|
||||||
import pygame
|
import pygame
|
||||||
from pygame import locals as pygamelocals
|
from pygame import locals as pygamelocals
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue