From 54e48c22d28c5e573b5af9dba0754d54a2f1b24a Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 07 May 2013 16:24:51 +0000 Subject: ord is not a type --- (limited to 'TurtleArt') diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 81eba2d..07cd6d6 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -79,9 +79,13 @@ def _color_to_num(c): def _num_type(x): """ Is x a number type? """ - if isinstance(x, (int, float, ord)): + if isinstance(x, (int, float)): return True - return False + try: + ord(x) + return True + finally: + return False def _millisecond(): @@ -1362,8 +1366,10 @@ variable')) """ Try to comvert a string to a number """ if isinstance(x, (int, float)): return(x) - if isinstance(x, ord): - return(int(x)) + try: + return int(ord(x)) + finally: + pass if isinstance(x, list): raise logoerror("#syntaxerror") if x in COLORDICT: -- cgit v0.9.1