diff --git a/bin/hy b/bin/hy index fbb396d..3998d3b 100755 --- a/bin/hy +++ b/bin/hy @@ -120,7 +120,7 @@ def koan_macro(tree): try: readline.read_history_file(history) except IOError: - open(history, 'wa').close() + open(history, 'a').close() readline.parse_and_bind("tab: complete") diff --git a/hy/completer.py b/hy/completer.py index e6b5666..5836912 100644 --- a/hy/completer.py +++ b/hy/completer.py @@ -20,7 +20,11 @@ import hy.macros import hy.compiler -import __builtin__ + +try: + import __builtin__ +except ImportError: + import builtins as __builtin__ # Py 3.3 PATH = [hy.compiler._compile_table, @@ -28,7 +32,7 @@ PATH = [hy.compiler._compile_table, __builtin__.__dict__] -class Completer: +class Completer(object): def __init__(self, namespace=None): if namespace and not isinstance(namespace, dict): raise TypeError('namespace must be a dictionary')