##// END OF EJS Templates
Don't reset the readline completer after each prompt...
Don't reset the readline completer after each prompt This makes it impossible to setup a custom completer. The comment says that "we must ensure that our completer is back in place," but I don't see why. All that does it make it impossible to use a different completer. One can trick IPython into not doing this by monkeypatching ip.has_readline to False, but then certain features like multiline editing are no longer enabled. See https://github.com/davidhalter/jedi/pull/321.

File last commit:

r7787:28b538a9
r12906:1363065e
Show More
daemonize.py
26 lines | 833 B | text/x-python | PythonLexer
MinRK
scrub twisted/deferred references from launchers...
r4019 """daemonize function from twisted.scripts._twistd_unix."""
#-----------------------------------------------------------------------------
# Copyright (c) Twisted Matrix Laboratories.
# See Twisted's LICENSE for details.
# http://twistedmatrix.com/
#-----------------------------------------------------------------------------
import os, errno
def daemonize():
# See http://www.erlenstar.demon.co.uk/unix/faq_toc.html#TOC16
if os.fork(): # launch child and...
os._exit(0) # kill off parent
os.setsid()
if os.fork(): # launch child and...
os._exit(0) # kill off parent again.
null = os.open('/dev/null', os.O_RDWR)
for i in range(3):
try:
os.dup2(null, i)
Matthias BUSSONNIER
conform to pep 3110...
r7787 except OSError as e:
MinRK
scrub twisted/deferred references from launchers...
r4019 if e.errno != errno.EBADF:
raise
os.close(null)