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
93e8e549
Commit
93e8e549
authored
Jun 13, 2003
by
Kurt B. Kaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interrupt module has been folded into the thread module
Modified Files: run.py Removed Files: interruptmodule.c
parent
a11e8461
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
54 deletions
+5
-54
Lib/idlelib/interruptmodule.c
Lib/idlelib/interruptmodule.c
+0
-49
Lib/idlelib/run.py
Lib/idlelib/run.py
+5
-5
No files found.
Lib/idlelib/interruptmodule.c
deleted
100644 → 0
View file @
a11e8461
/***********************************************************************
* interruptmodule.c
*
* Python extension implementing the interrupt module.
*
**********************************************************************/
#include "Python.h"
#ifndef PyDoc_STR
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STR(str) str
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#endif
/* module documentation */
PyDoc_STRVAR
(
module_doc
,
"Provide a way to interrupt the main thread from a subthread.
\n\n
\
In threaded Python code the KeyboardInterrupt is always directed to
\n
\
the thread which raised it. This extension provides a method,
\n
\
interrupt_main, which a subthread can use to raise a KeyboardInterrupt
\n
\
in the main thread."
);
/* module functions */
static
PyObject
*
setinterrupt
(
PyObject
*
self
,
PyObject
*
args
)
{
PyErr_SetInterrupt
();
Py_INCREF
(
Py_None
);
return
Py_None
;
}
/* registration table */
static
struct
PyMethodDef
methods
[]
=
{
{
"interrupt_main"
,
setinterrupt
,
METH_VARARGS
,
PyDoc_STR
(
"Interrupt the main thread"
)},
{
NULL
,
NULL
}
};
/* module initialization */
void
initinterrupt
(
void
)
{
(
void
)
Py_InitModule3
(
"interrupt"
,
methods
,
module_doc
);
}
Lib/idlelib/run.py
View file @
93e8e549
...
...
@@ -3,6 +3,7 @@ import os
import
time
import
socket
import
traceback
import
thread
import
threading
import
Queue
...
...
@@ -13,7 +14,6 @@ import RemoteDebugger
import
RemoteObjectBrowser
import
StackViewer
import
rpc
import
interrupt
import
__main__
...
...
@@ -189,7 +189,7 @@ class MyRPCServer(rpc.RPCServer):
except
EOFError
:
global
exit_now
exit_now
=
True
interrupt
.
interrupt_main
()
thread
.
interrupt_main
()
except
:
erf
=
sys
.
__stderr__
print
>>
erf
,
'
\
n
'
+
'-'
*
40
...
...
@@ -223,13 +223,13 @@ class MyHandler(rpc.RPCHandler):
"Override SocketIO method - terminate wait on callback and exit thread"
global
quitting
quitting
=
True
interrupt
.
interrupt_main
()
thread
.
interrupt_main
()
def
decode_interrupthook
(
self
):
"interrupt awakened thread"
global
quitting
quitting
=
True
interrupt
.
interrupt_main
()
thread
.
interrupt_main
()
class
Executive
:
...
...
@@ -256,7 +256,7 @@ class Executive:
flush_stdout
()
def
interrupt_the_server
(
self
):
interrupt
.
interrupt_main
()
thread
.
interrupt_main
()
def
start_the_debugger
(
self
,
gui_adap_oid
):
return
RemoteDebugger
.
start_debugger
(
self
.
rpchandler
,
gui_adap_oid
)
...
...
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