Skip to content

Commit

Permalink
improve pypy workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Jun 21, 2015
1 parent 93a6a80 commit 1fd0d1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions python2-scripts/mcpipy/mcpi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import atexit
import os
import platform
from util import flatten_parameters_to_string

""" @author: Aron Nieminen, Mojang AB"""
Expand All @@ -29,10 +30,13 @@ def __init__(self, address=None, port=None):
self.socket.connect((address, port))
self.readFile = self.socket.makefile("r")
self.lastSent = ""
atexit.register(self.close)
if platform.system() == "Windows":
atexit.register(self.close)

def __del__(self):
self.close()
if platform.system() == "Windows":
self.close()
atexit.unregister(self.close)

def close(self):
try:
Expand Down
2 changes: 1 addition & 1 deletion python2-scripts/mcpipy/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ def angleToTextDirection(angle):
del sys.argv[0]
text = " ".join(sys.argv)

pos = drawText(mc, fonts.FONTS['tallfont'], pos, forward, minecraft.Vec3(0,1,0), text, foreground, background)
drawText(mc, fonts.FONTS['tallfont'], pos, forward, minecraft.Vec3(0,1,0), text, foreground, background)

0 comments on commit 1fd0d1e

Please sign in to comment.