Skip to content

Commit 19305ed

Browse files
committed
Compatibilty with python3.9
1 parent 79fa135 commit 19305ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/pyff/resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from datetime import datetime
1414
from enum import Enum
1515
from threading import Condition, Lock
16-
from typing import TYPE_CHECKING, Any, Callable
16+
from typing import TYPE_CHECKING, Any, Callable, Optional
1717
from urllib.parse import quote as urlescape
1818

1919
import requests
@@ -160,7 +160,7 @@ def i_handle(self, t: Resource, url=None, response=None, exception=None, last_fe
160160
class ResourceOpts(BaseModel):
161161
alias: str | None = Field(None, alias='as') # TODO: Rename to 'name'?
162162
# a certificate (file) or a SHA1 fingerprint to use for signature verification
163-
verify: list[str] = []
163+
verify: Optional[list[str]] = None
164164
# TODO: move classes to make the correct typing work: Iterable[Union[Lambda, PipelineCallback]] = Field([])
165165
via: list[Callable] = Field([])
166166
# A list of callbacks that can be used to pre-process parsed metadata before validation. Use as a clue-bat.

src/pyff/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ def redis():
263263
return thread_data.redis
264264

265265

266-
def check_signature(t: ElementTree, keys: list = [], only_one_signature: bool = False) -> ElementTree:
267-
if len(keys) != 0:
266+
def check_signature(t: ElementTree, keys: Optional[list[str]] = None, only_one_signature: bool = False) -> ElementTree:
267+
if keys:
268268
refs = []
269269
for key in keys:
270270
log.debug(f"verifying signature using {key}")

0 commit comments

Comments
 (0)