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
a02083d5
Commit
a02083d5
authored
Nov 30, 2002
by
Kurt B. Kaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M PyShell.py
M rpc.py SF Bug 629987: Idle not printing prompts following SyntaxError
parent
73085b2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
17 deletions
+20
-17
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+18
-16
Lib/idlelib/rpc.py
Lib/idlelib/rpc.py
+2
-1
No files found.
Lib/idlelib/PyShell.py
View file @
a02083d5
#! /usr/bin/env python
import
os
import
os.path
import
sys
import
string
import
getopt
...
...
@@ -24,7 +25,6 @@ from UndoDelegator import UndoDelegator
from
OutputWindow
import
OutputWindow
from
configHandler
import
idleConf
import
idlever
import
os.path
import
rpc
import
RemoteDebugger
...
...
@@ -417,6 +417,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
except
(
OverflowError
,
SyntaxError
):
self
.
tkconsole
.
resetoutput
()
InteractiveInterpreter
.
showsyntaxerror
(
self
,
filename
)
self
.
tkconsole
.
showprompt
()
else
:
self
.
runcode
(
code
)
...
...
@@ -458,23 +459,24 @@ class ModifiedInterpreter(InteractiveInterpreter):
"""
text
=
self
.
tkconsole
.
text
stuff
=
self
.
unpackerror
()
if
not
stuff
:
if
stuff
:
msg
,
lineno
,
offset
,
line
=
stuff
if
lineno
==
1
:
pos
=
"iomark + %d chars"
%
(
offset
-
1
)
else
:
pos
=
"iomark linestart + %d lines + %d chars"
%
\
(
lineno
-
1
,
offset
-
1
)
text
.
tag_add
(
"ERROR"
,
pos
)
text
.
see
(
pos
)
char
=
text
.
get
(
pos
)
if
char
and
char
in
IDENTCHARS
:
text
.
tag_add
(
"ERROR"
,
pos
+
" wordstart"
,
pos
)
self
.
tkconsole
.
resetoutput
()
InteractiveInterpreter
.
showsyntaxerror
(
self
,
filename
)
return
msg
,
lineno
,
offset
,
line
=
stuff
if
lineno
==
1
:
pos
=
"iomark + %d chars"
%
(
offset
-
1
)
self
.
write
(
"SyntaxError: %s
\
n
"
%
str
(
msg
))
else
:
pos
=
"iomark linestart + %d lines + %d chars"
%
(
lineno
-
1
,
offset
-
1
)
text
.
tag_add
(
"ERROR"
,
pos
)
text
.
see
(
pos
)
char
=
text
.
get
(
pos
)
if
char
and
char
in
IDENTCHARS
:
text
.
tag_add
(
"ERROR"
,
pos
+
" wordstart"
,
pos
)
self
.
tkconsole
.
resetoutput
()
self
.
write
(
"SyntaxError: %s
\
n
"
%
str
(
msg
))
self
.
tkconsole
.
resetoutput
()
InteractiveInterpreter
.
showsyntaxerror
(
self
,
filename
)
self
.
tkconsole
.
showprompt
()
def
unpackerror
(
self
):
type
,
value
,
tb
=
sys
.
exc_info
()
...
...
Lib/idlelib/rpc.py
View file @
a02083d5
...
...
@@ -90,7 +90,7 @@ objecttable = {}
class
SocketIO
:
debugging
=
0
debugging
=
False
def
__init__
(
self
,
sock
,
objtable
=
None
,
debugging
=
None
):
self
.
mainthread
=
threading
.
currentThread
()
...
...
@@ -189,6 +189,7 @@ class SocketIO:
def
asyncreturn
(
self
,
seq
):
response
=
self
.
getresponse
(
seq
)
self
.
debug
(
"asyncreturn:"
,
response
)
return
self
.
decoderesponse
(
response
)
def
decoderesponse
(
self
,
response
):
...
...
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