mirror of
https://github.com/WolframResearch/WolframLanguageForJupyter.git
synced 2025-04-17 20:26:04 +00:00
Limit the Quit[] and Exit[] redefinition to the arguments that the actual Quit[] and Exit[] can take
This commit is contained in:
parent
1607ff07cd
commit
6cca28f8ab
@ -101,29 +101,43 @@ If[
|
||||
to quit, if running under
|
||||
a Jupyter console
|
||||
*************************************)
|
||||
|
||||
|
||||
Unprotect[Quit];
|
||||
Quit[ourArgs___, opts:OptionsPattern[]] :=
|
||||
Quit[ourArgs___] :=
|
||||
Block[
|
||||
{$inQuit = True},
|
||||
If[
|
||||
loopState["isCompleteRequestSent"],
|
||||
loopState["askExit"] = True;,
|
||||
Quit[ourArgs, opts];
|
||||
Quit[ourArgs];
|
||||
];
|
||||
] /; !TrueQ[$inQuit];
|
||||
] /;
|
||||
(
|
||||
(!TrueQ[$inQuit]) &&
|
||||
(
|
||||
(Length[{ourArgs}] == 0) ||
|
||||
((Length[{ourArgs}] == 1) && IntegerQ[ourArgs])
|
||||
)
|
||||
);
|
||||
Protect[Quit];
|
||||
|
||||
Unprotect[Exit];
|
||||
Exit[ourArgs___, opts:OptionsPattern[]] :=
|
||||
Exit[ourArgs___] :=
|
||||
Block[
|
||||
{$inExit = True},
|
||||
If[
|
||||
loopState["isCompleteRequestSent"],
|
||||
loopState["askExit"] = True;,
|
||||
Exit[ourArgs, opts];
|
||||
Exit[ourArgs];
|
||||
];
|
||||
] /; !TrueQ[$inExit];
|
||||
] /;
|
||||
(
|
||||
(!TrueQ[$inExit]) &&
|
||||
(
|
||||
(Length[{ourArgs}] == 0) ||
|
||||
((Length[{ourArgs}] == 1) && IntegerQ[ourArgs])
|
||||
)
|
||||
);
|
||||
Protect[Exit];
|
||||
|
||||
(************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user