From 530ac9230d7774ed2409d1e45420e1922e05bf53 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 05 May 2013 12:22:37 +0000 Subject: change type()== to isisintance --- (limited to 'turtleblocks.py') diff --git a/turtleblocks.py b/turtleblocks.py index 2fe9b45..ed2ebce 100755 --- a/turtleblocks.py +++ b/turtleblocks.py @@ -496,12 +496,12 @@ class TurtleMain(): save_type = '.lg' filename, self.tw.load_save_folder = get_save_name(save_type, self.tw.load_save_folder, 'logosession') - if type(filename) == unicode: - f = file(filename.encode('ascii', 'replace'), 'w') - else: + if isinstance(filename, unicode): + filename = filename.encode('ascii', 'replace') + if filename is not None: f = file(filename, 'w') - f.write(logocode) - f.close() + f.write(logocode) + f.close() def _do_resize_cb(self, widget, factor): ''' Callback to resize blocks. ''' -- cgit v0.9.1