def puts(s='', newline=True, stream=STDOUT): """ Wrap puts to avoid getting called twice by Werkzeug reloader. """ if not is_werkzeug_process(): try: return _puts(s, newline, stream) except UnicodeEncodeError: return _puts(s.encode(sys.stdout.encoding), newline, stream)
def puts(string='', newline=True, stream=STDOUT): _puts(safe_str(string), newline, stream)