Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
py_compile.PyCompileError Class Reference
Inheritance diagram for py_compile.PyCompileError:
Inheritance graph
Collaboration diagram for py_compile.PyCompileError:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def __str__

Public Attributes


Detailed Description

Exception raised when an error occurs while attempting to
compile the file.

To raise this exception, use

    raise PyCompileError(exc_type,exc_value,file[,msg])


    exc_type:   exception type to be used in error message
                type name can be accesses as class variable

    exc_value:  exception value to be used in error message
                can be accesses as class variable 'exc_value'

    file:       name of file being compiled to be used in error message
                can be accesses as class variable 'file'

    msg:        string message to be written as error message
                If no value is given, a default exception message will be
                given, consistent with 'standard' py_compile output.
                message (or default) can be accesses as class variable

Definition at line 20 of file

Constructor & Destructor Documentation

def py_compile.PyCompileError.__init__ (   self,
  msg = '' 

Definition at line 48 of file

00049     def __init__(self, exc_type, exc_value, file, msg=''):
00050         exc_type_name = exc_type.__name__
00051         if exc_type is SyntaxError:
00052             tbtext = ''.join(traceback.format_exception_only(
00053                 exc_type, exc_value))
00054             errmsg = tbtext.replace('File "<string>"', 'File "%s"' % file)
00055         else:
00056             errmsg = "Sorry: %s: %s" % (exc_type_name,exc_value)
00058         Exception.__init__(self,msg or errmsg,exc_type_name,exc_value,file)
00060         self.exc_type_name = exc_type_name
00061         self.exc_value = exc_value
00062         self.file = file
00063         self.msg = msg or errmsg

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

Definition at line 64 of file

00065     def __str__(self):
00066         return self.msg

Member Data Documentation

Definition at line 59 of file

Definition at line 60 of file

Definition at line 61 of file

Definition at line 62 of file

The documentation for this class was generated from the following file: