Merge pull request #925 from dreadatour/patch-1

Python errors handling in 'pyedit' command
pull/927/head
Nils Winkler 2017-03-22 08:38:36 +01:00 committed by GitHub
commit 596dbb2b7c
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ function pyedit() {
example '$ pyedit requests' example '$ pyedit requests'
group 'python' group 'python'
xpyc=`python -c "import sys; stdout = sys.stdout; sys.stdout = sys.stderr; import $1; stdout.write($1.__file__)"` xpyc=`python -c "import os, sys; f = open(os.devnull, 'w'); sys.stderr = f; module = __import__('$1'); sys.stdout.write(module.__file__)"`
if [ "$xpyc" == "" ]; then if [ "$xpyc" == "" ]; then
echo "Python module $1 not found" echo "Python module $1 not found"