cq: Use union operator

This commit is contained in:
wurstsalat
2023-06-11 12:39:01 +02:00
parent 298406cc22
commit 77c9c8818f
5 changed files with 12 additions and 20 deletions

View File

@@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with OpenPGP Gajim Plugin. If not, see <http://www.gnu.org/licenses/>.
from typing import Optional
import logging
from nbxmpp.protocol import JID
@@ -46,7 +44,7 @@ class KeyringItem:
return False
return jid == self.jid
def _get_uid(self) -> Optional[str]:
def _get_uid(self) -> str | None:
for uid in self._key.uids:
try:
return parse_uid(uid.uid)

View File

@@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with OpenPGP Gajim Plugin. If not, see <http://www.gnu.org/licenses/>.
from typing import Optional
import logging
import gnupg
@@ -53,7 +51,7 @@ class KeyringItem:
def keyid(self) -> str:
return self._key['keyid']
def _get_uid(self) -> Optional[str]:
def _get_uid(self) -> str | None:
for uid in self._key['uids']:
try:
return parse_uid(uid)