diff --git a/easygui/boxes/choice_box.py b/easygui/boxes/choice_box.py index 1c5b973..d5bf3d7 100644 --- a/easygui/boxes/choice_box.py +++ b/easygui/boxes/choice_box.py @@ -73,7 +73,7 @@ def make_list_or_none(obj, cast_type=None): if cast_type is not None: try: ret_val = cast_type(obj) - except Exception, e: + except Exception as e: raise Exception("Value {} cannot be converted to type: {}".format(obj, cast_type)) ret_val = [ret_val,] # Convert all elements to cast_type diff --git a/test_cases/SimpleCv.py b/test_cases/SimpleCv.py index fe6fc93..01ad111 100644 --- a/test_cases/SimpleCv.py +++ b/test_cases/SimpleCv.py @@ -4,6 +4,7 @@ from: http://stackoverflow.com/questions/27873818/easygui-and-simplecv-typeerror-module-object-is-not-callable +Note: this module has a lot of dependencies: SimpleCV, OpenCV, PIL """ import sys diff --git a/test_cases/file_open_box.py b/test_cases/file_open_box.py index dcbd344..98282e2 100644 --- a/test_cases/file_open_box.py +++ b/test_cases/file_open_box.py @@ -8,4 +8,4 @@ sys.path.append('..') import easygui f = easygui.fileopenbox() -print f \ No newline at end of file +print(f) \ No newline at end of file diff --git a/test_cases/gps_auto_update.py b/test_cases/gps_auto_update.py index ad234eb..6700b18 100644 --- a/test_cases/gps_auto_update.py +++ b/test_cases/gps_auto_update.py @@ -7,9 +7,13 @@ """ +import sys +if sys.version_info.major > 2: + print("Sorry, the module gps is not included in Python 3") + sys.exit() + import gps from easygui import * -import sys # Listen on port 2947 (gpsd) of localhost session = gps.gps("localhost", "2947") session.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE) @@ -37,4 +41,4 @@ quit() except StopIteration: session = None - print "GPSD has terminated" \ No newline at end of file + print("GPSD has terminated") \ No newline at end of file diff --git a/test_cases/weather_man.py b/test_cases/weather_man.py deleted file mode 100644 index 3c4579b..0000000 --- a/test_cases/weather_man.py +++ /dev/null @@ -1,10 +0,0 @@ -__author__ = 'Robert' - -""" -Sample application using new API to display weather conditions -""" - -import requests -from pprint import pprint -r = requests.get('http://api.openweathermap.org/data/2.5/weather?q=Portland,ME,US') -pprint(r.json()) \ No newline at end of file