Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
3f992524bb
1
AUTHORS
1
AUTHORS
@ -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
22
bin/hy
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user