summaryrefslogtreecommitdiff
path: root/SoftwareProperties/aptsources.py
diff options
context:
space:
mode:
authorglatzor@ubuntu.com <>2006-07-27 22:40:09 +0200
committerglatzor@ubuntu.com <>2006-07-27 22:40:09 +0200
commit2179699f8b08b68be792cb0e5f263931475fc26d (patch)
treefdbf7393acb0e0fc5af678c976cd944ba790270f /SoftwareProperties/aptsources.py
parent7403f3888293e0c9ff544a218decaf6b428b2396 (diff)
downloadpython-apt-2179699f8b08b68be792cb0e5f263931475fc26d.tar.gz
* add an error handler if the locale is not in the iso country list
Diffstat (limited to 'SoftwareProperties/aptsources.py')
-rw-r--r--SoftwareProperties/aptsources.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 40b55dfa..a4d16fa0 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -563,7 +563,10 @@ class Distribution:
country_code = locale[a+1:z].lower()
self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
country_code
- self.country = self.countries[country_code]
+ if self.countries.has_key(country_code):
+ self.country = self.countries[country_code]
+ else:
+ self.country = None
# other used servers
for medium in self.used_media: