Skip to content

Commit

Permalink
Fixed a bug in choice_box.py which crashed Python 3
Browse files Browse the repository at this point in the history
Eliminated test_case "weather_man.py", because it had to connection to easygui
Fixed a Python3- incompatability in test_cases/file_open_box.py
  • Loading branch information
Thomas Haslwanter committed Aug 1, 2016
1 parent d5d2434 commit de06e28
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion easygui/boxes/choice_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test_cases/SimpleCv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test_cases/file_open_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
sys.path.append('..')
import easygui
f = easygui.fileopenbox()
print f
print(f)
8 changes: 6 additions & 2 deletions test_cases/gps_auto_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -37,4 +41,4 @@
quit()
except StopIteration:
session = None
print "GPSD has terminated"
print("GPSD has terminated")
10 changes: 0 additions & 10 deletions test_cases/weather_man.py

This file was deleted.

0 comments on commit de06e28

Please sign in to comment.