summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-27 19:17:02 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 11:47:04 (GMT)
commit2709f4e802770af4b2182dcb67ee275e00011c0a (patch)
tree7b2d955613fb4f609ee668c2d971959aab1da6ba
parentb84cd2bbdb2ddecaafdc87ba06db106d325ec1e0 (diff)
common.unicodeString is now hopefully failsafe
-rw-r--r--src/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common.py b/src/common.py
index f014c5e..389b168 100644
--- a/src/common.py
+++ b/src/common.py
@@ -426,8 +426,11 @@ def unicodeString(s, encoding='utf-8'):
return unicode(s)
elif isinstance(s, unicode):
return s
- else:
+ elif hasattr(s, 'decode'):
return s.decode(encoding)
+ else:
+# auf s5 testen mit ./kajonggtest.py --game=8001 --ruleset=DMJL --git=a46635d..23aca3b --log --clients=2 --servers=2 --count=4
+ return repr(s)
def isStringType(s):