diff options
author | Guido van Rossum <guido@python.org> | 2007-10-16 18:12:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-10-16 18:12:55 (GMT) |
commit | 3172c5d263eeffff1e89d03d79be3ccc1d60fbde (patch) | |
tree | a35e103b36b684c4682ded57236199d6a0ecee4b /Lib/uu.py | |
parent | 60d241f135f10312f5a638846659d7e471f6cac9 (diff) | |
download | cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.zip cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.tar.gz cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.tar.bz2 |
Patch# 1258 by Christian Heimes: kill basestring.
I like this because it makes the code shorter! :-)
Diffstat (limited to 'Lib/uu.py')
-rwxr-xr-x | Lib/uu.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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') |