Merge pull request #21 from cedk/master

Fix issue20: don't fail if netrc is not readable by us
This commit is contained in:
Sebastian Spaeth 2012-01-09 07:36:32 -08:00
commit 62b8027dfe

View File

@ -138,7 +138,7 @@ class IMAPRepository(BaseRepository):
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
if inst.errno not in (errno.ENOENT, errno.EACCES):
raise
else:
if netrcentry:
@ -235,7 +235,7 @@ class IMAPRepository(BaseRepository):
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
if inst.errno not in (errno.ENOENT, errno.EACCES):
raise
else:
if netrcentry: