mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Remove re.LOCALE flag
Starting with python 3.6, the re.LOCALE flag can only be used with byte patterns, and errors out if used with str. This patch removes the flag in get_translated_hotkey(). References: https://bugs.launchpad.net/apparmor/+bug/1661766 Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
This commit is contained in:
parent
20817ef77b
commit
633f833a6e
1 changed files with 2 additions and 2 deletions
|
@ -64,8 +64,8 @@ def get_translated_hotkey(translated, cmsg=''):
|
|||
msg = 'PromptUser: ' + _('Invalid hotkey for')
|
||||
|
||||
# Originally (\S) was used but with translations it would not work :(
|
||||
if re.search('\((\S+)\)', translated, re.LOCALE):
|
||||
return re.search('\((\S+)\)', translated, re.LOCALE).groups()[0]
|
||||
if re.search('\((\S+)\)', translated):
|
||||
return re.search('\((\S+)\)', translated).groups()[0]
|
||||
else:
|
||||
if cmsg:
|
||||
raise AppArmorException(cmsg)
|
||||
|
|
Loading…
Add table
Reference in a new issue