From 94040dfbd3e7cd42176180a04a32312aa5f19dde Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Mon, 17 Dec 2012 10:01:02 -0500 Subject: [PATCH] python3ing the code --- hy/lang/string.py | 9 ++++++++- hy/lang/symbol.py | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hy/lang/string.py b/hy/lang/string.py index 44a9144..6648c52 100644 --- a/hy/lang/string.py +++ b/hy/lang/string.py @@ -1,6 +1,13 @@ from hy.lang.hyobj import HYObject +import sys -class HYString(unicode, HYObject): +if sys.version_info[0] >= 3: + _str_type = str +else: + _str_type = unicode + + +class HYString(_str_type, HYObject): def __init__(self, string): self += string diff --git a/hy/lang/symbol.py b/hy/lang/symbol.py index 14f3b03..0add991 100644 --- a/hy/lang/symbol.py +++ b/hy/lang/symbol.py @@ -1,7 +1,7 @@ -from hy.lang.hyobj import HYObject +from hy.lang.string import HYString -class HYSymbol(unicode, HYObject): +class HYSymbol(HYString): def __init__(self, string): self += string