adriank / ObjectPath

The agile query language for semi-structured data
http://objectpath.org
MIT License
380 stars 93 forks source link

It will only complain about missing pytz when running in interactive. #36

Closed PeterHeja closed 9 years ago

PeterHeja commented 9 years ago

Without this commit, the objectpath would print into everything if it couldn't import the pytz. Now, it will only complain if the stdin is not a file and the stdout is a tty - so you will get an error if you open up the interactive interpreter, or when you run a script as ./script.py, but not if you echo "string" | ./script.py or ./script.py | egrep -e "regex". The earlier pull was mistakenly about two commits instead of only this one - the other one is in another pull request already.