Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced absolute PIL import with relative import #7173

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/PIL/IcnsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import struct
import sys

from PIL import Image, ImageFile, PngImagePlugin, features
from . import Image, ImageFile, PngImagePlugin, features

enable_jpeg2k = features.check_codec("jpg_2000")
if enable_jpeg2k:
from PIL import Jpeg2KImagePlugin
from . import Jpeg2KImagePlugin

MAGIC = b"icns"
HEADERSIZE = 8
Expand Down
6 changes: 3 additions & 3 deletions src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import sys
from enum import IntEnum

from PIL import Image
from . import Image

try:
from PIL import _imagingcms
from . import _imagingcms
except ImportError as ex:
# Allow error import for doc purposes, but error out when accessing
# anything in core.
Expand Down Expand Up @@ -271,7 +271,7 @@ def get_display_profile(handle=None):
if sys.platform != "win32":
return None

from PIL import ImageWin
from . import ImageWin

if isinstance(handle, ImageWin.HDC):
profile = core.get_display_profile_win32(handle, 1)
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/ImageShow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys
from shlex import quote

from PIL import Image
from . import Image

_viewers = []

Expand Down
4 changes: 2 additions & 2 deletions src/PIL/SpiderImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import struct
import sys

from PIL import Image, ImageFile
from . import Image, ImageFile


def isInt(f):
Expand Down Expand Up @@ -191,7 +191,7 @@

# returns a ImageTk.PhotoImage object, after rescaling to 0..255
def tkPhotoImage(self):
from PIL import ImageTk
from . import ImageTk

Check warning on line 194 in src/PIL/SpiderImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/SpiderImagePlugin.py#L194

Added line #L194 was not covered by tests

return ImageTk.PhotoImage(self.convert2byte(), palette=256)

Expand Down