Scott David Daniels wrote: > > Match the new warning protocol exactly: > def showwarning(message, category, filename, lineno, > file=None, line=None): > ... > If the line is not None, use it (which will happen if you pass it > along to showwarning). > If the line is None and file is not None, use file to get to your > line, rather than opening the filename which may not work. >
Sorry, this had no sooner left my terminal than I realized that the file argument is the output target, and nothing to do with fetching source. I'd not put the data into the log if file is provided, because it may be code trying to extract output formatting. I'd do something like this: if file is not None: old_showwarning(message, category, filename, lineno, file, line) return at the top of the code. --Scott David Daniels [EMAIL PROTECTED] _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com