summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/project.py b/project.py
index 43f4713c..76d4d0d5 100644
--- a/project.py
+++ b/project.py
@@ -1465,10 +1465,16 @@ class Project(object):
1465 try: 1465 try:
1466 r = urllib2.urlopen(req) 1466 r = urllib2.urlopen(req)
1467 except urllib2.HTTPError, e: 1467 except urllib2.HTTPError, e:
1468 def _content_type():
1469 try:
1470 return e.info()['content-type']
1471 except:
1472 return None
1473
1468 if e.code == 404: 1474 if e.code == 404:
1469 keep = False 1475 keep = False
1470 return False 1476 return False
1471 elif e.info()['content-type'] == 'text/plain': 1477 elif _content_type() == 'text/plain':
1472 try: 1478 try:
1473 msg = e.read() 1479 msg = e.read()
1474 if len(msg) > 0 and msg[-1] == '\n': 1480 if len(msg) > 0 and msg[-1] == '\n':