2015-04-06 02:11:26 +02:00
|
|
|
"""
|
|
|
|
This module stores code used for making pyCraft compatible with
|
|
|
|
both Python2 and Python3 while using the same codebase.
|
|
|
|
"""
|
|
|
|
|
|
|
|
# Raw input -> input shenangians
|
|
|
|
# example
|
|
|
|
# > from minecraft.compat import input
|
|
|
|
# > input("asd")
|
2015-04-06 02:21:50 +02:00
|
|
|
|
|
|
|
# Hi, I'm pylint, and sometimes I act silly, at which point my programmer
|
|
|
|
# overlords need to correct me.
|
|
|
|
|
2015-04-06 15:27:42 +02:00
|
|
|
# pylint: disable=undefined-variable,redefined-builtin,invalid-name
|
2015-04-06 02:11:26 +02:00
|
|
|
try:
|
|
|
|
input = raw_input
|
|
|
|
except NameError:
|
2015-04-12 04:26:12 +02:00
|
|
|
input = input
|
2016-03-07 03:40:25 +01:00
|
|
|
|
|
|
|
try:
|
|
|
|
unicode = unicode
|
|
|
|
except NameError:
|
|
|
|
unicode = str
|
2015-04-06 15:27:42 +02:00
|
|
|
# pylint: enable=undefined-variable,redefined-builtin,invalid-name
|