Skip to content

Commit

Permalink
Merge pull request #5472 from avylove/lockfile_fix
Browse files Browse the repository at this point in the history
PR: Don't rely on process name when detecting a previous instance
  • Loading branch information
ccordoba12 authored Nov 27, 2017
2 parents 7a978f4 + 989638f commit b593750
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spyder/utils/external/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@ def lock(self):
conditions = ['spyder' in c.lower()
for c in p.cmdline()]
else:
conditions = [p.name() == 'spyder',
p.name() == 'spyder3']
# For DEV
conditions += ['bootstrap.py' in p.cmdline()]
# Valid names for main script
names = set(['spyder', 'spyder3', 'bootstrap.py'])
# Check the first three command line arguments
arguments = set(os.path.basename(arg)
for arg in p.cmdline()[:3])
conditions = [names & arguments]
if not any(conditions):
raise(OSError(errno.ESRCH, 'No such process'))
except OSError as e:
Expand Down

0 comments on commit b593750

Please sign in to comment.