Break Python 3.2 compatibility
This commit is contained in:
parent
344b7b108b
commit
6475a57402
33
wolfbot.py
33
wolfbot.py
@ -17,30 +17,37 @@
|
|||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import botconfig
|
||||||
|
|
||||||
if sys.version_info < (3, 2):
|
if sys.version_info < (3, 2):
|
||||||
print("Python 3.2 or newer is required to run the bot.")
|
print("Python 3.2 or newer is required to run the bot.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if sys.version_info < (3, 3):
|
if sys.version_info < (3, 3):
|
||||||
print("*** WARNING ***".center(80),
|
allow_unsup = getattr(botconfig, "allow_unsupported_Python", None)
|
||||||
"Starting February 2016, Python 3.2 support will be officially dropped.",
|
# add an "allow_unsupported_Python" attribute in botconfig
|
||||||
"The minimum requirement will be increased to Python 3.3",
|
# set it to the tuple (3, 2) to prevent the bot from exiting
|
||||||
"Please make sure to upgrade by then, or stick with an older revision.", "",
|
# this backwards-compatibility fix will not remain for long
|
||||||
"Concerns and questions may be asked on the official development channel",
|
# please update to 3.3 if you can. if you can't, you will need
|
||||||
" in ##werewolf-dev over at irc.freenode.net", "",
|
# to stick with an older revision, and new bugfixes/features
|
||||||
"You may also open an issue on the issue tracker in the GitHub repository",
|
# will not be applied to the 3.2-supported versions
|
||||||
" located at https://github.com/lykoss/lykos", "",
|
# we will also not provide any more support
|
||||||
"The lifetime of Python 3.2 support may be extended on request.", "",
|
print("As of the 1st of February 2016, support for Python 3.2 is gone.",
|
||||||
"Thank you for your interest in this IRC bot!", "",
|
"You need Python 3.3 or above to run the bot from this point onwards.",
|
||||||
"- The lykos development team", "", sep="\n", file=sys.stderr)
|
"Please upgrade your installed Python version to run the bot.",
|
||||||
|
"", "Thank you for your interest!", "- The lykos development team",
|
||||||
|
sep="\n", file=sys.stderr)
|
||||||
|
|
||||||
import traceback
|
if allow_unsup != (3, 2):
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
print("\n...\nFine, fine, I'll run anyway", file=sys.stderr)
|
||||||
|
|
||||||
from oyoyo.client import IRCClient
|
from oyoyo.client import IRCClient
|
||||||
|
|
||||||
import botconfig
|
|
||||||
import src
|
import src
|
||||||
from src import handler
|
from src import handler
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user