File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 554.0.0 201x/xx/xx
66 - MSS: renamed MSSBase to MSSMixin in base.py
77 - Linux: ensure resources are freed in grab()
8+ - Windows: avoid unecessary class attributes
89 - MSS: fix Flake8 C408: Unnecessary dict call - rewrite as a literal, in exceptions.py
910 - MSS: fix Flake8 I100: Import statements are in the wrong order
1011 - MSS: fix Flake8 I201: Missing newline before sections or imports
Original file line number Diff line number Diff line change @@ -52,18 +52,15 @@ class BITMAPINFO(ctypes.Structure):
5252class MSS (MSSMixin ):
5353 """ Multiple ScreenShots implementation for Microsoft Windows. """
5454
55- _bbox = {"height" : 0 , "width" : 0 }
56- _bmp = None
57- _data = None
58- _memdc = None
59- _srcdc = None
60-
6155 def __init__ (self ):
6256 # type: () -> None
6357 """ Windows initialisations. """
6458
6559 self ._monitors = [] # type: List[Dict[str, int]]
6660
61+ self ._bbox = {"height" : 0 , "width" : 0 }
62+ self ._bmp = None
63+
6764 self .monitorenumproc = ctypes .WINFUNCTYPE (
6865 ctypes .wintypes .INT ,
6966 ctypes .wintypes .DWORD ,
@@ -100,7 +97,8 @@ def __exit__(self, *args):
10097 # type: (*str) -> None
10198 """ Cleanup. """
10299
103- for attr in (self ._bmp , self ._memdc , self ._srcdc ):
100+ for attribute in {"_bmp" , "_memdc" , "_srcdc" }:
101+ attr = getattr (self , attribute , None )
104102 if attr :
105103 ctypes .windll .gdi32 .DeleteObject (attr )
106104
You can’t perform that action at this time.
0 commit comments