Minor py3.3 fixes

This commit is contained in:
James King 2013-04-02 14:38:21 -04:00
parent 3826a05612
commit aa3a4e54cd
2 changed files with 7 additions and 3 deletions

2
bin/hy
View File

@ -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")

View File

@ -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')