From: Brett Cannon Date: Mon, 17 Jun 2013 21:48:30 +0000 (-0400) Subject: Issue #17222: fix a mix-up in some exception messages. X-Git-Tag: v3.4.0a1~455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9674bd0a94dc487dba151636152e9f9fe67b35cc;p=python Issue #17222: fix a mix-up in some exception messages. Reported by Arfrever Frehtes Taifersar Arahesis. --- diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 9919debca0..1277b93ea5 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -112,11 +112,11 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1): if os.path.islink(cfile): msg = ('{} is a symlink and will be changed into a regular file if ' 'import writes a byte-compiled file to it') - raise FileExistsError(msg.format(file, cfile)) + raise FileExistsError(msg.format(cfile)) elif os.path.exists(cfile) and not os.path.isfile(cfile): msg = ('{} is a non-regular file and will be changed into a regular ' 'one if import writes a byte-compiled file to it') - raise FileExistsError(msg.format(file, cfile)) + raise FileExistsError(msg.format(cfile)) loader = importlib.machinery.SourceFileLoader('', file) source_bytes = loader.get_data(file) try: