Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/utils.py

Issue 4790980679041024: Issue 2268 - Deprecate setupStderr() (Closed)
Patch Set: Improved warning text Created April 9, 2015, 9:18 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/__init__.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/utils.py
===================================================================
--- a/sitescripts/utils.py
+++ b/sitescripts/utils.py
@@ -82,8 +82,13 @@
def setupStderr(stream=sys.stderr):
"""
Sets up sys.stderr to accept Unicode characters, redirects error output to
- the stream passed in if any.
+ the stream passed in if any. DEPRECATED
"""
+ import warnings
+ warnings.warn('setupStderr() is deprecated. If you write '
+ 'text to stderr that might be non-ASCII use '
+ 'the "logging" module instead.', DeprecationWarning, 2)
+
sys.stderr = codecs.getwriter('utf8')(stream)
def anonymizeMail(email):
« no previous file with comments | « sitescripts/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld