else:
if os.uname()[0] == 'Darwin':
# Try to detect if the X11 server is running on OSX
- if commands.getstatusoutput("ps ax -o command|grep -q '/.*X11 .* %s'" % os.environ['DISPLAY'])[0] != 0:
+ if commands.getstatusoutput("ps ax -o command|grep -q '^/.*X11 .* %s'" % os.environ['DISPLAY'])[0] != 0:
# X11 is not running for this display
return