Skip to content

Commit

Permalink
Fix -d option with Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
fgallaire committed Aug 7, 2016
1 parent 035efcf commit 5f17fee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion achilterm.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH achilterm "1" "August 2016" "achilterm 0.19" "User commands"
.TH achilterm "1" "August 2016" "achilterm 0.20" "User commands"
.SH NAME
Achilterm \- Web based terminal written in python

Expand Down
8 changes: 4 additions & 4 deletions achilterm/achilterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

__version__ = '0.19'
__version__ = '0.20'

import array,cgi,fcntl,glob,mimetypes,optparse,os,pty,random,re,signal,select,sys,threading,time,termios,struct,pwd

Expand Down Expand Up @@ -566,8 +566,8 @@ def main():
if pid == 0:
#os.setsid() ?
os.setpgrp()
nullin = file('/dev/null', 'r')
nullout = file('/dev/null', 'w')
nullin = open('/dev/null', 'r')
nullout = open('/dev/null', 'w')
os.dup2(nullin.fileno(), sys.stdin.fileno())
os.dup2(nullout.fileno(), sys.stdout.fileno())
os.dup2(nullout.fileno(), sys.stderr.fileno())
Expand All @@ -578,7 +578,7 @@ def main():
os.setuid(pwd.getpwnam(o.uid).pw_uid)
else:
try:
file(o.pidfile,'w+').write(str(pid)+'\n')
open(o.pidfile,'w+').write(str(pid)+'\n')
except:
pass
print('Achilterm at http://localhost:%s/ pid: %d' % (o.port,pid))
Expand Down

0 comments on commit 5f17fee

Please sign in to comment.