Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Bob Tolbert 2013-06-23 18:14:43 -06:00
commit 3f992524bb
2 changed files with 22 additions and 1 deletions

View File

@ -12,3 +12,4 @@
* John Jacobsen <john@mail.npxdesigns.com> * John Jacobsen <john@mail.npxdesigns.com>
* rogererens <roger.erens@e-s-c.biz> * rogererens <roger.erens@e-s-c.biz>
* Thomas Ballinger <thomasballinger@gmail.com> * Thomas Ballinger <thomasballinger@gmail.com>
* Morten Linderud <mcfoxax@gmail.com>

22
bin/hy
View File

@ -1,9 +1,29 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
from hy.cmdline import cmdline_handler from hy.cmdline import cmdline_handler
class HyQuitter(object):
def __init__(self, name):
self.name = name
def __repr__(self):
return "Use (%s) or Ctrl-D (i.e. EOF) to exit" % (self.name)
__str__ = __repr__
def __call__(self, code=None):
try:
sys.stdin.close()
except:
pass
raise SystemExit(code)
__builtins__.quit = HyQuitter('quit')
__builtins__.exit = HyQuitter('exit')
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(cmdline_handler("hy", sys.argv)) sys.exit(cmdline_handler("hy", sys.argv))