Remove support for Python 2.7

This commit is contained in:
joo committed 2020-08-17 07:10:10 +02:00
1 parent 3723655fa3
commit b79f8b30eb
13 files changed
+10 -62

No files matched your search

-24
View File
@@ -1,24 +0,0 @@
"""
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")
# Hi, I'm pylint, and sometimes I act silly, at which point my programmer
# overlords need to correct me.
# pylint: disable=undefined-variable,redefined-builtin,invalid-name
try:
input = raw_input
except NameError:
input = input
try:
unicode = unicode
except NameError:
unicode = str
# pylint: enable=undefined-variable,redefined-builtin,invalid-name
+4 -6
View File
@@ -1,5 +1,3 @@
from __future__ import print_function
from collections import deque
from threading import RLock
import zlib
@@ -11,8 +9,6 @@ import sys
import json
import re
from future.utils import raise_
from .types import VarInt
from .packets import clientbound, serverbound
from . import packets
@@ -491,7 +487,8 @@ class Connection(object):
# If allowed by the final exception handler, re-raise the exception.
if self.handle_exception is None and not caught:
raise_(*exc_info)
exc_value, exc_tb = exc_info[1:]
raise exc_value.with_traceback(exc_tb)
def _version_mismatch(self, server_protocol=None, server_version=None):
if server_protocol is None:
@@ -592,7 +589,8 @@ class NetworkingThread(threading.Thread):
exc_info = None
if exc_info is not None:
raise_(*exc_info)
exc_value, exc_tb = exc_info[1:]
raise exc_value.with_traceback(exc_tb)
class PacketReactor(object):
-1
View File
@@ -2,7 +2,6 @@
Each type has a method which is used to read and write it.
These definitions and methods are used by the packet definitions
"""
from __future__ import division
import struct
import uuid
-2
View File
@@ -1,8 +1,6 @@
"""Minecraft data types that are used by packets, but don't have a specific
network representation.
"""
from __future__ import division
from collections import namedtuple
from itertools import chain