Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

scss/__init__.py: raise RuntimeWarning instead of writing to sys.stderr when _speedups is not found #211

Closed hblanks closed 11 years ago

hblanks commented 11 years ago

It seems like the Pythonic way to handle import warnings is using the warnings module.

This pull request addresses issue #83 by raising a RuntimeWarning instead of writing to sys.stderr. This means that an warning is generally still presented to the user on import, but that the importer may choose how those warnings are displayed. With the current implementation, for instance, pyScss will write to stderr during uWSGI's import of a WSGI application that uses pyScss. Not a good thing.

eevee commented 11 years ago

Hmm. I'm honestly not sure if this is better off as a warning or a log message.

Either way, writing to sys.stderr is definitely wrong, so I'll gladly take this and figure it out later :)