Updated code quality removed print statement spaces in singleinstance.py #1833
|
@ -55,12 +55,9 @@ class singleinstance(object):
|
||||||
)
|
)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == 13:
|
if e.errno == 13:
|
||||||
print(
|
sys.exit(
|
||||||
'Another instance of this application'
|
'Another instance of this application is'
|
||||||
' is already running'
|
' already running')
|
||||||
)
|
|
||||||
sys.exit(-1)
|
|
||||||
print(e.errno)
|
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
pidLine = "%i\n" % self.lockPid
|
pidLine = "%i\n" % self.lockPid
|
||||||
|
@ -75,8 +72,9 @@ class singleinstance(object):
|
||||||
fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
self.lockPid = os.getpid()
|
self.lockPid = os.getpid()
|
||||||
except IOError:
|
except IOError:
|
||||||
|
|||||||
print ('Another instance of this application is already running')
|
sys.exit(
|
||||||
sys.exit(-1)
|
'Another instance of this application is'
|
||||||
|
' already running')
|
||||||
else:
|
else:
|
||||||
pidLine = "%i\n" % self.lockPid
|
pidLine = "%i\n" % self.lockPid
|
||||||
self.fp.truncate(0)
|
self.fp.truncate(0)
|
||||||
|
@ -99,7 +97,7 @@ class singleinstance(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return
|
return
|
||||||
print ("Cleaning up lockfile")
|
|
||||||
try:
|
try:
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
if hasattr(self, 'fd'):
|
if hasattr(self, 'fd'):
|
||||||
|
|
Reference in New Issue
Block a user
sys.exit('Another instance of this application is already running')
And the same above.
print(e.errno)
is also redundant as for me.Updated