summaryrefslogtreecommitdiff
path: root/Demo/tkinter/guido/ShellWindow.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-25 17:50:20 +0000
committerGeorg Brandl <georg@python.org>2010-10-25 17:50:20 +0000
commit856023a098c60ba0d2bcfd01c5cd8ccff7db97b5 (patch)
treee2af1c1b988b218c1408fac9db4b3dc3465819ea /Demo/tkinter/guido/ShellWindow.py
parent07e4f1565b8d922fe0df5cf3a15e113f7c562046 (diff)
downloadcpython-git-856023a098c60ba0d2bcfd01c5cd8ccff7db97b5.tar.gz
#3018: tkinter demo fixes for py3k.
Diffstat (limited to 'Demo/tkinter/guido/ShellWindow.py')
-rw-r--r--Demo/tkinter/guido/ShellWindow.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Demo/tkinter/guido/ShellWindow.py b/Demo/tkinter/guido/ShellWindow.py
index fffcbc5b97..c5a0401900 100644
--- a/Demo/tkinter/guido/ShellWindow.py
+++ b/Demo/tkinter/guido/ShellWindow.py
@@ -1,6 +1,5 @@
import os
import sys
-import string
from tkinter import *
from tkinter.scrolledtext import ScrolledText
from tkinter.dialog import Dialog
@@ -17,7 +16,7 @@ class ShellWindow(ScrolledText):
except KeyError:
shell = '/bin/sh'
shell = shell + ' -i'
- args = string.split(shell)
+ args = shell.split()
shell = args[0]
ScrolledText.__init__(self, master, **cnf)
@@ -33,7 +32,7 @@ class ShellWindow(ScrolledText):
self.outputhandler)
def outputhandler(self, file, mask):
- data = os.read(file, BUFSIZE)
+ data = os.read(file, BUFSIZE).decode()
if not data:
self.tk.deletefilehandler(file)
pid, sts = os.waitpid(self.pid, 0)
@@ -65,7 +64,7 @@ class ShellWindow(ScrolledText):
self.insert(END, "\n")
line = self.get(self.pos, "end - 1 char")
self.pos = self.index(END)
- os.write(self.tochild, line)
+ os.write(self.tochild, line.encode())
return "break"
def sendeof(self, *args):
@@ -132,7 +131,7 @@ def spawn(prog, args):
return pid, c2pread, p2cwrite
def test():
- shell = string.join(sys.argv[1:])
+ shell = ' '.join(sys.argv[1: ])
root = Tk()
root.minsize(1, 1)
if shell: