by
Changes to 2 files · Browse files at bea2cda18f91 Showing diff from parent b6e6b0606214 541d9229dc67 Diff from another changeset...
@@ -93,9 +93,12 @@ if not os.path.exists(self._path+'.dat'):
return
dbase = shelve.open(self._path)
- self._dbappname = dbase['APPNAME']
- self.version = dbase['VERSION']
- self._data.update(dbase.get('DATA', {}))
+ try:
+ self._dbappname = dbase['APPNAME']
+ self.version = dbase['VERSION']
+ self._data.update(dbase.get('DATA', {}))
+ except KeyError:
+ pass
dbase.close()
def write(self):
@@ -212,6 +215,7 @@ def shell_notify(paths):
try:
from win32com.shell import shell, shellcon
+ import pywintypes
except ImportError:
return
dirs = []
@@ -224,7 +228,10 @@ # send notifications to deepest directories first
dirs.sort(lambda x, y: len(y) - len(x))
for dir in dirs:
- pidl, ignore = shell.SHILCreateFromPath(dir, 0)
+ try:
+ pidl, ignore = shell.SHILCreateFromPath(dir, 0)
+ except pywintypes.com_error:
+ return
if pidl is None:
continue
shell.SHChangeNotify(shellcon.SHCNE_UPDATEITEM,
|
Loading...