Patch #590913: PEP 263 support.

This commit is contained in:
Martin v. Löwis 2002-08-05 14:55:21 +00:00
parent 5428fff111
commit eade4a1580
2 changed files with 188 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import string
import getopt
import re
import warnings
import types
import linecache
from code import InteractiveInterpreter
@ -188,6 +189,9 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.more = 0
self.save_warnings_filters = warnings.filters[:]
warnings.filterwarnings(action="error", category=SyntaxWarning)
if isinstance(source, types.UnicodeType):
import IOBinding
source = source.encode(IOBinding.encoding)
try:
return InteractiveInterpreter.runsource(self, source, filename)
finally: