summaryrefslogtreecommitdiff
path: root/test/ejabberd_SUITE_data/extauth.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/ejabberd_SUITE_data/extauth.py')
-rwxr-xr-xtest/ejabberd_SUITE_data/extauth.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ejabberd_SUITE_data/extauth.py b/test/ejabberd_SUITE_data/extauth.py
index b6a217fc..394c2126 100755
--- a/test/ejabberd_SUITE_data/extauth.py
+++ b/test/ejabberd_SUITE_data/extauth.py
@@ -1,8 +1,14 @@
import sys
import struct
+def read_from_stdin(bytes):
+ if hasattr(sys.stdin, 'buffer'):
+ return sys.stdin.buffer.read(bytes)
+ else:
+ return sys.stdin.read(bytes)
+
def read():
- (pkt_size,) = struct.unpack('>H', sys.stdin.read(2))
+ (pkt_size,) = struct.unpack('>H', read_from_stdin(2))
pkt = sys.stdin.read(pkt_size)
cmd = pkt.split(':')[0]
if cmd == 'auth':