AlkantarClanX12
Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/ |
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/code.cpython-39.pyc |
a R�f~) � @ s� d Z ddlZddlZddlmZmZ g d�ZG dd� d�ZG dd� de�Zdd d �Z e dkr�ddlZe�� Z e jdd dd� e �� Zejs�ejjr�dZndZe e� dS )z?Utilities needed to emulate Python's interactive interpreter. � N)�CommandCompiler�compile_command)�InteractiveInterpreter�InteractiveConsole�interactr c @ sF e Zd ZdZddd�Zddd�Zd d � Zddd�Zd d� Zdd� Z dS )r z�Base class for InteractiveConsole. This class deals with parsing and interpreter state (the user's namespace); it doesn't deal with input buffering or prompting or input file naming (the filename is always passed in explicitly). Nc C s$ |du rddd�}|| _ t� | _dS )a Constructor. The optional 'locals' argument specifies the dictionary in which code will be executed; it defaults to a newly created dictionary with key "__name__" set to "__console__" and key "__doc__" set to None. NZ__console__)�__name__�__doc__)�localsr �compile)�selfr � r �)/opt/alt/python39/lib64/python3.9/code.py�__init__ s zInteractiveInterpreter.__init__�<input>�singlec C sR z| � |||�}W n$ tttfy6 | �|� Y dS 0 |du rDdS | �|� dS )a� Compile and run some source in the interpreter. Arguments are as for compile_command(). One of several things can happen: 1) The input is incorrect; compile_command() raised an exception (SyntaxError or OverflowError). A syntax traceback will be printed by calling the showsyntaxerror() method. 2) The input is incomplete, and more input is required; compile_command() returned None. Nothing happens. 3) The input is complete; compile_command() returned a code object. The code is executed by calling self.runcode() (which also handles run-time exceptions, except for SystemExit). The return value is True in case 2, False in the other cases (unless an exception is raised). The return value can be used to decide whether to use sys.ps1 or sys.ps2 to prompt the next line. FNT)r � OverflowError�SyntaxError� ValueError�showsyntaxerror�runcode)r �source�filenameZsymbol�coder r r � runsource&