ok
Direktori : /lib64/python3.6/__pycache__/ |
Current File : //lib64/python3.6/__pycache__/code.cpython-36.pyc |
3 \v) � @ s� d Z ddlZddlZddlZddlmZmZ ddddgZG dd� d�ZG d d� de�Z dd d�Z edkr�ej� Z e jdd dd� e j� 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$ |dkrddd�}|| _ 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 �/usr/lib64/python3.6/code.py�__init__ s zInteractiveInterpreter.__init__�<input>�singlec C sR y| j |||�}W n$ tttfk r6 | j|� dS X |dkrDdS | j|� dS )a� Compile and run some source in the interpreter. Arguments are as for compile_command(). One 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'