From b9ad7d31aae4aac391dbba23a489ee3ee746ffe3 Mon Sep 17 00:00:00 2001 From: albert-- Date: Sat, 1 Nov 2014 19:23:20 +0100 Subject: [PATCH] Update hexchat.py fix for python 3 --- hexchat.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hexchat.py b/hexchat.py index 0bcc5c5..faa134b 100644 --- a/hexchat.py +++ b/hexchat.py @@ -6,6 +6,21 @@ import functools import types +#taken from: http://www.rfk.id.au/blog/entry/preparing-pyenchant-for-python-3/ +try: + unicode = unicode +except NameError: + # 'unicode' is undefined, must be Python 3 + str = str + unicode = str + bytes = bytes + basestring = (str,bytes) +else: + # 'unicode' exists, must be Python 2 + str = str + unicode = unicode + bytes = str + __version__ = (1, 0)