Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
f76b777b
Commit
f76b777b
authored
May 16, 2017
by
Ian Wood
Browse files
don't fail if shelf pickle file broken
parent
13cefbed
Changes
1
Hide whitespace changes
Inline
Side-by-side
senpy/plugins/__init__.py
View file @
f76b777b
...
...
@@ -96,7 +96,10 @@ class ShelfMixin(object):
if
not
hasattr
(
self
,
'_sh'
)
or
self
.
_sh
is
None
:
self
.
__dict__
[
'_sh'
]
=
{}
if
os
.
path
.
isfile
(
self
.
shelf_file
):
self
.
__dict__
[
'_sh'
]
=
pickle
.
load
(
open
(
self
.
shelf_file
,
'rb'
))
try
:
self
.
__dict__
[
'_sh'
]
=
pickle
.
load
(
open
(
self
.
shelf_file
,
'rb'
))
except
EOFError
:
logger
.
warning
(
'corrupted shelf file!'
)
return
self
.
_sh
@
sh
.
deleter
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment