summaryrefslogtreecommitdiff
path: root/SoftwareProperties
diff options
context:
space:
mode:
Diffstat (limited to 'SoftwareProperties')
-rw-r--r--SoftwareProperties/aptsources.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index c0d2c2ba..03459adf 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -201,8 +201,9 @@ class SourcesList:
except IndexError: # ok, somethings wrong here
#print "IndexError"
return False
- # remove the leading "<country>." and see if that helps
- if compare_srv[compare_srv.index(".")+1:] == master_srv:
+ # remove the leading "<country>." (if any) and see if that helps
+ if "." in compare_srv and \
+ compare_srv[compare_srv.index(".")+1:] == master_srv:
#print "Mirror"
return True
return False