File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import re
2727import subprocess
2828import sys
29- import tempfile
3029from typing import IO
3130
3231from . import Image , ImageFile
@@ -92,6 +91,8 @@ def Ghostscript(
9291 res_x = 72.0 * width / (bbox [2 ] - bbox [0 ])
9392 res_y = 72.0 * height / (bbox [3 ] - bbox [1 ])
9493
94+ import tempfile
95+
9596 out_fd , outfile = tempfile .mkstemp ()
9697 os .close (out_fd )
9798
Original file line number Diff line number Diff line change 3636import re
3737import struct
3838import sys
39- import tempfile
4039import warnings
4140from collections .abc import MutableMapping
4241from enum import IntEnum
@@ -738,6 +737,8 @@ def _dump(
738737 if not filename .endswith (suffix ):
739738 filename += suffix
740739 else :
740+ import tempfile
741+
741742 f , filename = tempfile .mkstemp (suffix )
742743 os .close (f )
743744
Original file line number Diff line number Diff line change 2121import shutil
2222import subprocess
2323import sys
24- import tempfile
2524
2625from . import Image
2726
@@ -40,6 +39,8 @@ def grab(
4039 scale_down : bool = False ,
4140) -> Image .Image :
4241 im : Image .Image
42+ import tempfile
43+
4344 if xdisplay is None :
4445 if sys .platform == "darwin" :
4546 fh , filepath = tempfile .mkstemp (".png" )
Original file line number Diff line number Diff line change 4040import struct
4141import subprocess
4242import sys
43- import tempfile
4443import warnings
4544
4645from . import Image , ImageFile
@@ -467,6 +466,7 @@ def draft(
467466
468467 def load_djpeg (self ) -> None :
469468 # ALTERNATIVE: handle JPEGs via the IJG command line utilities
469+ import tempfile
470470
471471 f , path = tempfile .mkstemp ()
472472 os .close (f )
You can’t perform that action at this time.
0 commit comments