File tree 2 files changed +6
-7
lines changed 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 5
5
4.0.0 201x/xx/xx
6
6
- MSS: renamed MSSBase to MSSMixin in base.py
7
7
- Linux: ensure resources are freed in grab()
8
+ - Windows: avoid unecessary class attributes
8
9
- MSS: fix Flake8 C408: Unnecessary dict call - rewrite as a literal, in exceptions.py
9
10
- MSS: fix Flake8 I100: Import statements are in the wrong order
10
11
- 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):
52
52
class MSS (MSSMixin ):
53
53
""" Multiple ScreenShots implementation for Microsoft Windows. """
54
54
55
- _bbox = {"height" : 0 , "width" : 0 }
56
- _bmp = None
57
- _data = None
58
- _memdc = None
59
- _srcdc = None
60
-
61
55
def __init__ (self ):
62
56
# type: () -> None
63
57
""" Windows initialisations. """
64
58
65
59
self ._monitors = [] # type: List[Dict[str, int]]
66
60
61
+ self ._bbox = {"height" : 0 , "width" : 0 }
62
+ self ._bmp = None
63
+
67
64
self .monitorenumproc = ctypes .WINFUNCTYPE (
68
65
ctypes .wintypes .INT ,
69
66
ctypes .wintypes .DWORD ,
@@ -100,7 +97,8 @@ def __exit__(self, *args):
100
97
# type: (*str) -> None
101
98
""" Cleanup. """
102
99
103
- for attr in (self ._bmp , self ._memdc , self ._srcdc ):
100
+ for attribute in {"_bmp" , "_memdc" , "_srcdc" }:
101
+ attr = getattr (self , attribute , None )
104
102
if attr :
105
103
ctypes .windll .gdi32 .DeleteObject (attr )
106
104
You can’t perform that action at this time.
0 commit comments