diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-01-29 03:49:43 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-01-29 03:49:43 (GMT) |
commit | 2c60f7a13697bbc19c4d5ef0b052c34cf1848244 (patch) | |
tree | 7e33cdc40b1e60ad8729008f344bb8849e1373e1 /Lib/py_compile.py | |
parent | c0c12b57070a5b494662bebc418e3958bf5bdbee (diff) | |
download | cpython-2c60f7a13697bbc19c4d5ef0b052c34cf1848244.zip cpython-2c60f7a13697bbc19c4d5ef0b052c34cf1848244.tar.gz cpython-2c60f7a13697bbc19c4d5ef0b052c34cf1848244.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r-- | Lib/py_compile.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 95d6a08..2f4206d 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -24,24 +24,24 @@ class PyCompileError(Exception): raise PyCompileError(exc_type,exc_value,file[,msg]) where - + exc_type: exception type to be used in error message type name can be accesses as class variable 'exc_type_name' - + 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 'msg' - + """ - + def __init__(self, exc_type, exc_value, file, msg=''): exc_type_name = exc_type.__name__ if exc_type is SyntaxError: @@ -49,7 +49,7 @@ class PyCompileError(Exception): errmsg = tbtext.replace('File "<string>"', 'File "%s"' % file) else: errmsg = "Sorry: %s: %s" % (exc_type_name,exc_value) - + Exception.__init__(self,msg or errmsg,exc_type_name,exc_value,file) self.exc_type_name = exc_type_name @@ -94,7 +94,7 @@ def compile(file, cfile=None, dfile=None, doraise=False): and the function will return to the caller. If an exception occurs and this flag is set to True, a PyCompileError exception will be raised. - + Note that it isn't necessary to byte-compile Python modules for execution efficiency -- Python itself byte-compiles a module when it is loaded, and if it can, writes out the bytecode to the @@ -159,6 +159,6 @@ def main(args=None): compile(filename, doraise=True) except PyCompileError,err: sys.stderr.write(err.msg) - + if __name__ == "__main__": main() |