fix with python <2.6

This commit is contained in:
Romain Bignon 2011-02-07 15:36:31 +01:00
commit df1ae8cdb9

View file

@ -16,6 +16,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
from __future__ import with_statement
import urllib2 import urllib2
from xml.dom import minidom from xml.dom import minidom
@ -82,7 +84,6 @@ class YahooBackend(BaseBackend, ICapWeather):
cid = line.split("/?unit")[0].split('-')[-1] cid = line.split("/?unit")[0].split('-')[-1]
yield City(cid, (city+", "+region+", "+country).decode('utf-8')) yield City(cid, (city+", "+region+", "+country).decode('utf-8'))
def _get_weather_dom(self, city_id): def _get_weather_dom(self, city_id):
handler = urllib2.urlopen(self.WEATHER_URL % (city_id, 'c')) handler = urllib2.urlopen(self.WEATHER_URL % (city_id, 'c'))
dom = minidom.parse(handler) dom = minidom.parse(handler)