From bfb3ce8138b1bc8014de36393e03a693e4a0266f Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Tue, 18 Dec 2012 23:44:44 -0500 Subject: [PATCH] fiddle bits --- bin/hython | 3 ++- hy/lang/importer.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/hython b/bin/hython index 2f343ca..5e8681d 100755 --- a/bin/hython +++ b/bin/hython @@ -7,7 +7,8 @@ from code import InteractiveConsole import sys if len(sys.argv) > 1: - mod = _hy_import_file(sys.argv[1], '__main__') + sys.argv = sys.argv[1:] + mod = _hy_import_file(sys.argv[0], '__main__') sys.exit(0) diff --git a/hy/lang/importer.py b/hy/lang/importer.py index c17a8c9..39401b3 100644 --- a/hy/lang/importer.py +++ b/hy/lang/importer.py @@ -36,6 +36,7 @@ class MetaImporter(object): mod.__file__ = self.path mod.__name__ = name mod.__loader__ = self + mod.__package__ = name.rpartition('.')[0] sys.modules[name] = mod return sys.modules[name]