Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
22291c45
Commit
22291c45
authored
Mar 26, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn SyntasWarning into SyntaxError for all code entered
interactively.
parent
26a1e8bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Tools/idle/PyShell.py
Tools/idle/PyShell.py
+12
-1
No files found.
Tools/idle/PyShell.py
View file @
22291c45
...
@@ -5,6 +5,7 @@ import sys
...
@@ -5,6 +5,7 @@ import sys
import
string
import
string
import
getopt
import
getopt
import
re
import
re
import
warnings
import
linecache
import
linecache
from
code
import
InteractiveInterpreter
from
code
import
InteractiveInterpreter
...
@@ -180,7 +181,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -180,7 +181,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
# Extend base class to stuff the source in the line cache first
# Extend base class to stuff the source in the line cache first
filename
=
self
.
stuffsource
(
source
)
filename
=
self
.
stuffsource
(
source
)
self
.
more
=
0
self
.
more
=
0
return
InteractiveInterpreter
.
runsource
(
self
,
source
,
filename
)
self
.
save_warnings_filters
=
warnings
.
filters
[:]
warnings
.
filterwarnings
(
action
=
"error"
,
category
=
SyntaxWarning
)
try
:
return
InteractiveInterpreter
.
runsource
(
self
,
source
,
filename
)
finally
:
if
self
.
save_warnings_filters
is
not
None
:
warnings
.
filters
[:]
=
self
.
save_warnings_filters
self
.
save_warnings_filters
=
None
def
stuffsource
(
self
,
source
):
def
stuffsource
(
self
,
source
):
# Stuff source in the filename cache
# Stuff source in the filename cache
...
@@ -249,6 +257,9 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -249,6 +257,9 @@ class ModifiedInterpreter(InteractiveInterpreter):
def
runcode
(
self
,
code
):
def
runcode
(
self
,
code
):
# Override base class method
# Override base class method
if
self
.
save_warnings_filters
is
not
None
:
warnings
.
filters
[:]
=
self
.
save_warnings_filters
self
.
save_warnings_filters
=
None
debugger
=
self
.
debugger
debugger
=
self
.
debugger
try
:
try
:
self
.
tkconsole
.
beginexecuting
()
self
.
tkconsole
.
beginexecuting
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment