Fix several bugs caused or exposed by running in Python 3.

This commit is contained in:
joo committed 2016-06-17 20:38:18 +01:00
1 parent 471350cea8
commit c8b3e7a809
6 files changed
+15 -23

No files matched your search

+6 -5
View File
@@ -13,6 +13,8 @@ import sys
import json
import re
from future.utils import raise_
from ..compat import unicode
from .types import VarInt
from . import packets
@@ -259,7 +261,7 @@ class NetworkingThread(threading.Thread):
self.connection.file_object)
if exc_info is not None:
raise exc_info[0], exc_info[1], exc_info[2]
raise_(*exc_info)
time.sleep(0.05)
@@ -290,11 +292,10 @@ class PacketReactor(object):
for packet in self.__class__.get_clientbound_packets(context)}
def read_packet(self, stream):
ready_to_read = select.select([self.connection.socket], [], [],
self.TIME_OUT)[0]
ready_to_read = select.select([stream], [], [], self.TIME_OUT)[0]
if self.connection.socket in ready_to_read:
length = VarInt.read_socket(self.connection.socket)
if stream in ready_to_read:
length = VarInt.read(stream)
packet_data = packets.PacketBuffer()
packet_data.send(stream.read(length))