Skip to content

Commit ac23174

Browse files
committed
WIN32: Replaced bare except (thanks to Avasam): clauses with except Exception:, preventing accidental suppression of system-exit signals (KeyboardInterrupt, SystemExit) during error handling.
ALL: Removed unused dependency on `typing_extensions` (thanks to Avasam - https://github.com/Avasam) ALL: Deprecated PyWinBox class in favor of WindowBox (window areas) and ScreenBox (screen areas) ALL: Added general functions: collidepoint, collidebox, contains, clip, union ALL: Added class methods: collidepoint, collidebox, contains, clip, union, move, inflate, clamp, isclamped, unclamp, fit
1 parent 21fc784 commit ac23174

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/pywinbox/_main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def __init__(self,
141141

142142
self._handle :int | NamedTuple | object | None = handle
143143
self._box :Box = box or Box(0, 0, 0, 0)
144-
self._onQuery: Callable[[], Box] | None = onQuery or self.onQuery
145-
self._onSet: Callable[[Box], None] | None = onSet or self.onSet
144+
self._onQuery: Callable[[], Box] = onQuery or self.onQuery
145+
self._onSet: Callable[[Box], None] = onSet or self.onSet
146146
self._clamp = None
147147

148148
def onQuery(self) -> Box:
@@ -666,10 +666,10 @@ def __init__(self,
666666
It can raise ValueError if not valid window handle is passed
667667
"""
668668
try:
669-
self._handle: int | str | NamedTuple | object = _getHandle(handle)
669+
handle: int | str | NamedTuple | object = _getHandle(handle)
670670
except Exception:
671-
self._handle = None
672-
if self._handle is None:
671+
handle = None
672+
if handle is None:
673673
raise ValueError
674674
BaseClass.__init__(self, handle=handle, onQuery=onQuery, onSet=onSet)
675675

0 commit comments

Comments
 (0)