Skip to content

Commit

Permalink
resolve python 3.12 syntax issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Whalley committed Jan 29, 2024
1 parent dcc46a0 commit 8c90fec
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/python/Components/Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def loadNetworkConfig(self, iface, callback=None):
callback(True)

def loadNameserverConfig(self):
ipRegexp = "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" # noqa: W605
ipRegexp = r"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" # noqa: W605
nameserverPattern = re.compile("nameserver +" + ipRegexp)
ipPattern = re.compile(ipRegexp)

Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/PackageInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def fillPackagesList(self, prerequisites=True):
self.directory = [self.directory]

for directory in self.directory:
packages += crawlDirectory(directory, ".*\.info$") # noqa: W605
packages += crawlDirectory(directory, r".*\.info$") # noqa: W605

for package in packages:
self.readInfo(package[0] + "/", package[0] + "/" + package[1])
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Renderer/NextEpgInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self):
self.hideLabel = 0
self.timecolor = ""
self.labelcolor = ""
self.foregroundColor = "\c00f0f0f0" # noqa: W605
self.foregroundColor = r"\c00f0f0f0" # noqa: W605
self.numOfSpaces = 1

GUI_WIDGET = eLabel
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Screens/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def populate(self):
tempinfo = ""
elif path.exists("/proc/hisi/msp/pm_cpu"):
try:
tempinfo = search("temperature = (\d+) degree", open("/proc/hisi/msp/pm_cpu").read()).group(1) # noqa: W605
tempinfo = search(r"temperature = (\d+) degree", open("/proc/hisi/msp/pm_cpu").read()).group(1) # noqa: W605
except:
tempinfo = ""
if tempinfo and int(tempinfo) > 0:
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Screens/ChannelSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ def exitContext(self, close=False):

class ChannelSelectionBase(Screen, HelpableScreen):

orbposReStr = "\(satellitePosition *== *(\d+)" # noqa: W605
orbposReStr = r"\(satellitePosition *== *(\d+)" # noqa: W605
orbposRe = None # Lazy compilation

def __init__(self, session):
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Tools/Hex2strColor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@


def Hex2strColor(rgb):
return "\c%08x" % rgb # noqa: W605
return r"\c%08x" % rgb # noqa: W605
2 changes: 1 addition & 1 deletion tools/genmetaindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
for i in p.findall("info"):
if not info:
info = i
assert info
assert info is not None

for i in info[:]:
if i.tag not in ["name", "packagename", "packagetype", "shortdescription"]:
Expand Down

0 comments on commit 8c90fec

Please sign in to comment.