diff --git a/vloed.py b/vloed.py index 145723c..701984c 100755 --- a/vloed.py +++ b/vloed.py @@ -8,6 +8,11 @@ code from https://github.com/defnull/pixelflut/ __version__ = 0.3 __author__ = "Jan Klopper " +if __name__ == '__main__': + # avoid nasty eception on python closing time + from gevent import spawn, monkey + monkey.patch_all() + import struct import time import socket @@ -301,11 +306,6 @@ def RunServer(options): options=options).serve_forever() 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 from pygame import locals as pygamelocals