Skip to content

Commit 525eaf7

Browse files
committed
Renamed file variable
1 parent 95f77ef commit 525eaf7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Tests/test_file_msp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
class TestFileMsp(PillowTestCase):
1313

1414
def test_sanity(self):
15-
file = self.tempfile("temp.msp")
15+
test_file = self.tempfile("temp.msp")
1616

17-
hopper("1").save(file)
17+
hopper("1").save(test_file)
1818

19-
im = Image.open(file)
19+
im = Image.open(test_file)
2020
im.load()
2121
self.assertEqual(im.mode, "1")
2222
self.assertEqual(im.size, (128, 128))

src/PIL/GifImagePlugin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,16 @@ def _save_netpbm(im, fp, filename):
604604

605605
import os
606606
from subprocess import Popen, check_call, PIPE, CalledProcessError
607-
file = im._dump()
607+
tempfile = im._dump()
608608

609609
with open(filename, 'wb') as f:
610610
if im.mode != "RGB":
611611
with open(os.devnull, 'wb') as devnull:
612-
check_call(["ppmtogif", file], stdout=f, stderr=devnull)
612+
check_call(["ppmtogif", tempfile], stdout=f, stderr=devnull)
613613
else:
614614
# Pipe ppmquant output into ppmtogif
615-
# "ppmquant 256 %s | ppmtogif > %s" % (file, filename)
616-
quant_cmd = ["ppmquant", "256", file]
615+
# "ppmquant 256 %s | ppmtogif > %s" % (tempfile, filename)
616+
quant_cmd = ["ppmquant", "256", tempfile]
617617
togif_cmd = ["ppmtogif"]
618618
with open(os.devnull, 'wb') as devnull:
619619
quant_proc = Popen(quant_cmd, stdout=PIPE, stderr=devnull)
@@ -632,7 +632,7 @@ def _save_netpbm(im, fp, filename):
632632
raise CalledProcessError(retcode, togif_cmd)
633633

634634
try:
635-
os.unlink(file)
635+
os.unlink(tempfile)
636636
except OSError:
637637
pass
638638

0 commit comments

Comments
 (0)