summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2021-05-25 18:22:20 +0200
committerBadlop <badlop@process-one.net>2021-05-25 18:39:18 +0200
commit1ee64091b3411b145721e1bfe3848beb17fc3b3d (patch)
tree7403bbb161e4b2f1cdb7e862726e49abc850bb71 /test
parentMySQL Backend Patch for scram-sha512 (#3582) (diff)
Fix extauth.py failure in test suite with Python 3 (#3612)
Diffstat (limited to 'test')
-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':