From 3172c5d263eeffff1e89d03d79be3ccc1d60fbde Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 16 Oct 2007 18:12:55 +0000 Subject: Patch# 1258 by Christian Heimes: kill basestring. I like this because it makes the code shorter! :-) --- Lib/uu.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Lib/uu.py') diff --git a/Lib/uu.py b/Lib/uu.py index 18a9f79c37..da096ea13f 100755 --- a/Lib/uu.py +++ b/Lib/uu.py @@ -46,7 +46,7 @@ def encode(in_file, out_file, name=None, mode=None): # if in_file == '-': in_file = sys.stdin.buffer - elif isinstance(in_file, basestring): + elif isinstance(in_file, str): if name is None: name = os.path.basename(in_file) if mode is None: @@ -60,7 +60,7 @@ def encode(in_file, out_file, name=None, mode=None): # if out_file == '-': out_file = sys.stdout.buffer - elif isinstance(out_file, basestring): + elif isinstance(out_file, str): out_file = open(out_file, 'wb') # # Set defaults for name and mode @@ -87,7 +87,7 @@ def decode(in_file, out_file=None, mode=None, quiet=0): # if in_file == '-': in_file = sys.stdin.buffer - elif isinstance(in_file, basestring): + elif isinstance(in_file, str): in_file = open(in_file, 'rb') # # Read until a begin is encountered or we've exhausted the file @@ -118,7 +118,7 @@ def decode(in_file, out_file=None, mode=None, quiet=0): opened = False if out_file == '-': out_file = sys.stdout.buffer - elif isinstance(out_file, basestring): + elif isinstance(out_file, str): fp = open(out_file, 'wb') try: os.path.chmod(out_file, mode) @@ -169,7 +169,7 @@ def test(): if options.decode: if options.text: - if isinstance(output, basestring): + if isinstance(output, str): output = open(output, 'wb') else: print(sys.argv[0], ': cannot do -t to stdout') @@ -177,7 +177,7 @@ def test(): decode(input, output) else: if options.text: - if isinstance(input, basestring): + if isinstance(input, str): input = open(input, 'rb') else: print(sys.argv[0], ': cannot do -t from stdin') -- cgit v1.2.1