@@ -429,8 +429,7 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
429429 # Built-in commands don't make use of this. It is purely there for user-defined commands and convenience.
430430 self ._last_result = None
431431
432- # Used by run_script command to store the current script dir as
433- # a LIFO queue to support _relative_run_script command
432+ # Used by run_script command to store current script dir as a LIFO queue to support _relative_run_script command
434433 self ._script_dir = []
435434
436435 # Context manager used to protect critical sections in the main thread from stopping due to a KeyboardInterrupt
@@ -3251,11 +3250,6 @@ def py_quit():
32513250 @with_argparser (run_pyscript_parser )
32523251 def do_run_pyscript (self , args : argparse .Namespace ) -> bool :
32533252 """Run a Python script file inside the console"""
3254- if args .__statement__ .command == "pyscript" :
3255- self .perror ("pyscript has been renamed and will be removed in the next release, "
3256- "please use run_pyscript instead\n " ,
3257- traceback_war = False , err_color = Fore .LIGHTYELLOW_EX )
3258-
32593253 script_path = os .path .expanduser (args .script_path )
32603254 py_return = False
32613255
@@ -3277,6 +3271,11 @@ def do_run_pyscript(self, args: argparse.Namespace) -> bool:
32773271 # Restore command line arguments to original state
32783272 sys .argv = orig_args
32793273
3274+ if args .__statement__ .command == "pyscript" :
3275+ self .perror ("pyscript has been renamed and will be removed in the next release, "
3276+ "please use run_pyscript instead\n " ,
3277+ traceback_war = False , err_color = Fore .LIGHTYELLOW_EX )
3278+
32803279 return py_return
32813280
32823281 # pyscript is deprecated
@@ -3654,11 +3653,6 @@ def do_run_script(self, args: argparse.Namespace) -> Optional[bool]:
36543653 Run commands in script file that is encoded as either ASCII or UTF-8 text
36553654 :return: True if running of commands should stop
36563655 """
3657- if args .__statement__ .command == "load" :
3658- self .perror ("load has been renamed and will be removed in the next release, "
3659- "please use run_script instead\n " ,
3660- traceback_war = False , err_color = Fore .LIGHTYELLOW_EX )
3661-
36623656 expanded_path = os .path .abspath (os .path .expanduser (args .script_path ))
36633657
36643658 # Make sure the path exists and we can access it
@@ -3704,6 +3698,10 @@ def do_run_script(self, args: argparse.Namespace) -> Optional[bool]:
37043698 # Check if a script dir was added before an exception occurred
37053699 if orig_script_dir_count != len (self ._script_dir ):
37063700 self ._script_dir .pop ()
3701+ if args .__statement__ .command == "load" :
3702+ self .perror ("load has been renamed and will be removed in the next release, "
3703+ "please use run_script instead\n " ,
3704+ traceback_war = False , err_color = Fore .LIGHTYELLOW_EX )
37073705
37083706 # load has been deprecated
37093707 do_load = do_run_script
0 commit comments