[datafeed] don't crash if python-kerberos isn't installed
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 16 Feb 2011 08:40:25 +0100
changeset 6995 6efb5a5696bd
parent 6994 4b2c7e401065
child 6997 88b4fdce7c91
child 6998 d662dfdfe495
[datafeed] don't crash if python-kerberos isn't installed
sobjects/parsers.py
--- a/sobjects/parsers.py	Tue Feb 15 23:32:32 2011 +0100
+++ b/sobjects/parsers.py	Wed Feb 16 08:40:25 2011 +0100
@@ -56,9 +56,12 @@
 DEFAULT_CONVERTERS['Interval'] = convert_interval
 
 # use a cookie enabled opener to use session cookie if any
-from logilab.common import urllib2ext
 _OPENER = urllib2.build_opener()
-_OPENER.add_handler(urllib2ext.HTTPGssapiAuthHandler())
+try:
+    from logilab.common import urllib2ext
+    _OPENER.add_handler(urllib2ext.HTTPGssapiAuthHandler())
+except ImportError: # python-kerberos not available
+    pass
 _OPENER.add_handler(urllib2.HTTPCookieProcessor(CookieJar()))
 
 def extract_typed_attrs(eschema, stringdict, converters=DEFAULT_CONVERTERS):