Permalink
Browse files

Merge pull request #1 from NelsonMinar/master

Small bug fix for no config file (Python 2.7.2)
  • Loading branch information...
2 parents aeafef4 + 421563a commit 96e667d834884527b5f6ed5cae26256a7aec0d0e @twaddington twaddington committed Apr 8, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 geoloqi/geoloqi.py
View
@@ -4,7 +4,7 @@
import urllib
import urllib2
-from ConfigParser import ConfigParser, NoOptionError
+from ConfigParser import ConfigParser, NoOptionError, NoSectionError
from version import __version__
from urllib2 import HTTPError, URLError
@@ -67,16 +67,22 @@ def __init__(self, api_key=None, api_secret=None, access_token=None):
self.api_key = self.config.get('Credentials', 'application_access_key')
except NoOptionError:
pass
+ except NoSectionError:
+ pass
if not self.api_secret:
try:
self.api_secret = self.config.get('Credentials', 'application_secret_key')
except NoOptionError:
pass
+ except NoSectionError:
+ pass
if not self.access_token:
try:
self.access_token = self.config.get('Credentials', 'user_access_token')
except NoOptionError:
pass
+ except NoSectionError:
+ pass
# Determine if Credentials exist
if not self.access_token and not (self.api_key and self.api_secret):

0 comments on commit 96e667d

Please sign in to comment.