]> granicus.if.org Git - python/commitdiff
Issue #17222: fix a mix-up in some exception messages.
authorBrett Cannon <brett@python.org>
Mon, 17 Jun 2013 21:48:30 +0000 (17:48 -0400)
committerBrett Cannon <brett@python.org>
Mon, 17 Jun 2013 21:48:30 +0000 (17:48 -0400)
Reported by Arfrever Frehtes Taifersar Arahesis.

Lib/py_compile.py

index 9919debca041f80a405cacc874672844d41efd44..1277b93ea5e37c1246ae008df8676d6149ff46ed 100644 (file)
@@ -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('<py_compile>', file)
     source_bytes = loader.get_data(file)
     try: