Do not try to list the mimetypes directory if it does not exist.

Fix #7837
This commit is contained in:
Marco Pesenti Gritti 2008-08-31 14:36:13 +02:00
parent 9f88241ff5
commit 938e2e9648

View File

@ -396,11 +396,12 @@ class ActivityBundle(Bundle):
if mime_types is not None: if mime_types is not None:
installed_icons_dir = os.path.join(xdg_data_home, installed_icons_dir = os.path.join(xdg_data_home,
'icons/sugar/scalable/mimetypes') 'icons/sugar/scalable/mimetypes')
for f in os.listdir(installed_icons_dir): if os.path.isdir(installed_icons_dir):
path = os.path.join(installed_icons_dir, f) for f in os.listdir(installed_icons_dir):
if os.path.islink(path) and \ path = os.path.join(installed_icons_dir, f)
os.readlink(path).startswith(install_path): if os.path.islink(path) and \
os.remove(path) os.readlink(path).startswith(install_path):
os.remove(path)
self._uninstall(install_path) self._uninstall(install_path)