Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-12-14 20:00:10 (GMT)
committer Walter Bender <walter@sugarlabs.org>2013-12-14 20:00:10 (GMT)
commit8fcb80b6bc42a1c3bbad8b5c19942c93ae6a1e12 (patch)
treeeb02daaac062e95ef1ae1e9db3ff7ef0002fe3c0
parent60111910ac4ea6d3e60ddb5caa852dbd8412b5a3 (diff)
fix potential issue with init values=[] (rgs)
-rw-r--r--TurtleArt/tablock.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py
index 402de33..81bdd2a 100644
--- a/TurtleArt/tablock.py
+++ b/TurtleArt/tablock.py
@@ -183,7 +183,7 @@ class Block:
trash -- block in the trash """
def __init__(self, block_list, sprite_list, name, x, y, type='block',
- values=[], scale=BLOCK_SCALE[0],
+ values=None, scale=BLOCK_SCALE[0],
colors=['#A0A0A0', '#808080']):
self.block_list = block_list
@@ -256,8 +256,9 @@ class Block:
self.font_size[i] *= self.scale * \
self.block_list.font_scale_factor
- for v in (values):
- self.values.append(v)
+ if values is not None:
+ for v in (values):
+ self.values.append(v)
# If there is already a block with the same name, reuse it
copy_block = None