Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/turtleblocks.py
diff options
context:
space:
mode:
Diffstat (limited to 'turtleblocks.py')
-rwxr-xr-xturtleblocks.py10
1 files changed, 5 insertions, 5 deletions
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. '''