Skip to content

Commit

Permalink
Merge from 3.x: PR #7515
Browse files Browse the repository at this point in the history
Fixes #7513
  • Loading branch information
ccordoba12 committed Jul 21, 2018
2 parents ce36408 + fefa51a commit ea9797e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spyder/widgets/projects/type/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,20 @@ def set_recent_files(self, recent_files):
for recent_file in recent_files[:]:
if not os.path.isfile(recent_file):
recent_files.remove(recent_file)
self.CONF[WORKSPACE].set('main', 'recent_files',
list(OrderedDict.fromkeys(recent_files)))
try:
self.CONF[WORKSPACE].set('main', 'recent_files',
list(OrderedDict.fromkeys(recent_files)))
except EnvironmentError:
pass

def get_recent_files(self):
"""Return a list of files opened by the project."""
recent_files = self.CONF[WORKSPACE].get('main', 'recent_files',
default=[])
try:
recent_files = self.CONF[WORKSPACE].get('main', 'recent_files',
default=[])
except EnvironmentError:
return []

for recent_file in recent_files[:]:
if not os.path.isfile(recent_file):
recent_files.remove(recent_file)
Expand Down

0 comments on commit ea9797e

Please sign in to comment.