Skip to content

Commit

Permalink
Use Optional and Union instead of "|" for Python 3.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
embar- authored Oct 13, 2024
1 parent 0fdb432 commit a52eb0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions safeeyes/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import random
from enum import Enum
from dataclasses import dataclass
from typing import Optional, Union

from packaging.version import parse

Expand Down Expand Up @@ -424,11 +425,11 @@ def build(cls, name, icon_path, icon_id, action):
@dataclass
class PluginDependency:
message: str
link: str|None = None
link: Optional[str] = None
retryable: bool = False

class RequiredPluginException(Exception):
def __init__(self, plugin_id, plugin_name: str, message: str|PluginDependency):
def __init__(self, plugin_id, plugin_name: str, message: Union[str, PluginDependency]):
if isinstance(message, PluginDependency):
msg = message.message
else:
Expand Down

0 comments on commit a52eb0a

Please sign in to comment.