From 2c2f42be55541c1500e63c9aff250aa9c0a6fb36 Mon Sep 17 00:00:00 2001 From: noirauds Date: Sun, 9 Feb 2014 11:02:01 +0100 Subject: [PATCH] bug 7368 : os.environ['http_proxy'] gives an error if http_proxy is not set. --- src/plugins/lib/maps/grampsmaps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/lib/maps/grampsmaps.py b/src/plugins/lib/maps/grampsmaps.py index 4289396ca..151f96906 100644 --- a/src/plugins/lib/maps/grampsmaps.py +++ b/src/plugins/lib/maps/grampsmaps.py @@ -188,16 +188,16 @@ class osmGpsMap(): constants.map_title[map_type]) config.set("geography.map_service", map_type) self.current_map = map_type - http_proxy = os.environ['http_proxy'] + http_proxy = os.environ.get('http_proxy') if 0: self.osm = DummyMapNoGpsPoint() else: - if http_proxy == "": + if http_proxy: self.osm = osmgpsmap.GpsMap(tile_cache=tiles_path, + proxy_uri=http_proxy, map_source=constants.map_type[map_type]) else: self.osm = osmgpsmap.GpsMap(tile_cache=tiles_path, - proxy_uri=http_proxy, map_source=constants.map_type[map_type]) current_map = osmgpsmap.GpsMapOsd( show_dpad=False, show_zoom=True) self.end_selection = None