ponty/pyscreenshot — pull request #8 by PamelaM (2013-01-30 02:15:10+00:00)
Title: Replaced hardcoded "python" excutable name with sys.executable

pyscreenshot wasn't working if pyscreenshot wasn't installed in the environment currently associated with the "python" command.

In my case, I was using it in my "python2.6" environment without using venv's.

By using sys.exectuable instead of hardcoding 'python', the EasyProcess calls will use the same python executable as the caller.

Here's the traceback I was getting:

>>> img = disp.waitgrab()
\Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.6/site-packages/pyvirtualdisplay/smartdisplay.py", line 68, in waitgrab
img = self.grab(autocrop=autocrop)
File "/Library/Python/2.6/site-packages/pyvirtualdisplay/smartdisplay.py", line 40, in grab
img = pyscreenshot.grab(childprocess=1, backend=self.pyscreenshot_backend)
File "/Library/Python/2.6/site-packages/pyscreenshot/__init__.py", line 36, in grab
"import pyscreenshot; pyscreenshot.grab_to_file(%s)" % params,
File "/Library/Python/2.6/site-packages/easyprocess/__init__.py", line 183, in check
raise EasyProcessError(self, 'check error, return code is not zero!')
easyprocess.EasyProcessError: check error, return code is not zero! ", line 1, in
ImportError: No module named pyscreenshot" timeout=False>
>>>