drop python 3.7 support (#1271)

* drop python 3.7 support

start using  PEP 572 assignment expressions

Update FAQ

improve how unsupported versions are informed

this should be clearer on why we refuse to continue

* add more asign-expressions
This commit is contained in:
Alfredo Monclus
2024-05-24 19:13:19 -03:00
committed by GitHub
parent 462d134b1e
commit 524aa0e7dc
8 changed files with 41 additions and 54 deletions

View File

@@ -40,8 +40,7 @@ try:
onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p):
onoff = struct.unpack('B', onoff_p.raw)[0]
if onoff:
if onoff := struct.unpack('B', onoff_p.raw)[0]:
state = struct.unpack('H', state_p.raw)[0]
libXext.XCloseDisplay(display)
return state
@@ -73,8 +72,7 @@ def get_wireless_interfaces():
return None
interfaces = []
for line in result:
match = re.search('^(\\S+)\\s+.*$', line)
if match:
if match := re.search('^(\\S+)\\s+.*$', line):
interfaces.append(match[1])
return interfaces