Skip to content

Commit 26402a0

Browse files
author
Shimoda
committed
fix for issue #150 , do not use the encoding argument in python2.
1 parent d7d0026 commit 26402a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python3-alpha/python-libs/ase/android.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
__author__ = 'Damon Kohler <[email protected]>'
1818

19+
import sys
1920
import time
2021
import collections
2122
import json
@@ -41,7 +42,10 @@ def __init__(self, addr=None):
4142
except:
4243
self.conn = self.launchSL4A(addr)
4344

44-
self.client = self.conn.makefile('rw', encoding='utf-8')
45+
if sys.version_info[0] == 2:
46+
self.client = self.conn.makefile('rw')
47+
else:
48+
self.client = self.conn.makefile('rw', encoding='utf-8')
4549
self.id = 0
4650
if HANDSHAKE is not None:
4751
self._authenticate(HANDSHAKE)

0 commit comments

Comments
 (0)