mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
[Private] class names should be CamelCase
This commit is contained in:
parent
d241e38120
commit
7fa92c67b1
|
@ -65,7 +65,7 @@ def test_deferred_error():
|
|||
# Arrange
|
||||
|
||||
# Act
|
||||
thing = _util.deferred_error(ValueError("Some error text"))
|
||||
thing = _util.DeferredError(ValueError("Some error text"))
|
||||
|
||||
# Assert
|
||||
with pytest.raises(ValueError):
|
||||
|
|
|
@ -50,7 +50,7 @@ except ImportError:
|
|||
# Use __version__ instead.
|
||||
from . import ImageMode, TiffTags, UnidentifiedImageError, __version__, _plugins
|
||||
from ._binary import i32le, o32be, o32le
|
||||
from ._util import deferred_error, is_path
|
||||
from ._util import DeferredError, is_path
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
|
@ -139,7 +139,7 @@ try:
|
|||
)
|
||||
|
||||
except ImportError as v:
|
||||
core = deferred_error(ImportError("The _imaging C module is not installed."))
|
||||
core = DeferredError(ImportError("The _imaging C module is not installed."))
|
||||
# Explanations for ways that we know we might have an import error
|
||||
if str(v).startswith("Module use of python"):
|
||||
# The _imaging C module is present, but not compiled for
|
||||
|
@ -613,7 +613,7 @@ class Image:
|
|||
# Instead of simply setting to None, we're setting up a
|
||||
# deferred error that will better explain that the core image
|
||||
# object is gone.
|
||||
self.im = deferred_error(ValueError("Operation on closed image"))
|
||||
self.im = DeferredError(ValueError("Operation on closed image"))
|
||||
|
||||
def _copy(self):
|
||||
self.load()
|
||||
|
|
|
@ -26,9 +26,9 @@ try:
|
|||
except ImportError as ex:
|
||||
# Allow error import for doc purposes, but error out when accessing
|
||||
# anything in core.
|
||||
from ._util import deferred_error
|
||||
from ._util import DeferredError
|
||||
|
||||
_imagingcms = deferred_error(ex)
|
||||
_imagingcms = DeferredError(ex)
|
||||
|
||||
DESCRIPTION = """
|
||||
pyCMS
|
||||
|
|
|
@ -64,7 +64,7 @@ def __getattr__(name):
|
|||
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
|
||||
|
||||
|
||||
class _imagingft_not_installed:
|
||||
class _ImagingFtNotInstalled:
|
||||
# module placeholder
|
||||
def __getattr__(self, id):
|
||||
raise ImportError("The _imagingft C module is not installed")
|
||||
|
@ -73,7 +73,7 @@ class _imagingft_not_installed:
|
|||
try:
|
||||
from . import _imagingft as core
|
||||
except ImportError:
|
||||
core = _imagingft_not_installed()
|
||||
core = _ImagingFtNotInstalled()
|
||||
|
||||
|
||||
# FIXME: add support for pilfont2 format (see FontFile.py)
|
||||
|
|
|
@ -39,9 +39,9 @@ try:
|
|||
except ImportError as ex:
|
||||
# Allow error import for doc purposes, but error out when accessing
|
||||
# anything in core.
|
||||
from ._util import deferred_error
|
||||
from ._util import DeferredError
|
||||
|
||||
FFI = ffi = deferred_error(ex)
|
||||
FFI = ffi = DeferredError(ex)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ def is_directory(f):
|
|||
return is_path(f) and os.path.isdir(f)
|
||||
|
||||
|
||||
class deferred_error:
|
||||
class DeferredError:
|
||||
def __init__(self, ex):
|
||||
self.ex = ex
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user