From 99b5ccda05b0b4473c4b150e32e07f9362398810 Mon Sep 17 00:00:00 2001 From: Et0h Date: Thu, 19 Jun 2014 19:31:49 +0100 Subject: [PATCH] Exception when not running Python 2.7 --- syncplayClient.py | 9 ++++++++- syncplayServer.py | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/syncplayClient.py b/syncplayClient.py index f0b8be3..3cb47e7 100755 --- a/syncplayClient.py +++ b/syncplayClient.py @@ -1,9 +1,16 @@ #!/usr/bin/env python -import site +import site, sys # libpath +try: + if ((sys.version_info.major != 2) or (sys.version_info.minor < 7)): + raise Exception("You must run Syncplay with Python 2.7!") +except AttributeError: + import warnings + warnings.warn("You must run Syncplay with Python 2.7!") + from syncplay.clientManager import SyncplayClientManager from syncplay.utils import blackholeStdoutForFrozenWindow diff --git a/syncplayServer.py b/syncplayServer.py index e441a5f..cf358b4 100755 --- a/syncplayServer.py +++ b/syncplayServer.py @@ -1,10 +1,17 @@ #!/usr/bin/env python #coding:utf8 -import site +import site, sys # libpath +try: + if ((sys.version_info.major != 2) or (sys.version_info.minor < 7)): + raise Exception("You must run Syncplay with Python 2.7!") +except AttributeError: + import warnings + warnings.warn("You must run Syncplay with Python 2.7!") + from twisted.internet import reactor from syncplay.server import SyncFactory, ConfigurationGetter