Skip to content

Commit 7852644

Browse files
committed
Be stricter about typing in two methods
Mypy 0.961 (yesterday) became more strict.
1 parent 1d5066b commit 7852644

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

planet/auth.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import json
1919
import logging
2020
import os
21+
import pathlib
22+
import typing
2123

2224
import httpx
2325
import jwt
@@ -49,7 +51,8 @@ def from_key(key: str) -> AuthType:
4951
return auth
5052

5153
@staticmethod
52-
def from_file(filename: str = None) -> AuthType:
54+
def from_file(
55+
filename: typing.Union[str, pathlib.Path] = None) -> AuthType:
5356
'''Create authentication from secret file.
5457
5558
The secret file is named `.planet.json` and is stored in the user
@@ -130,7 +133,7 @@ def value(self):
130133
def to_dict(self) -> dict:
131134
pass
132135

133-
def write(self, filename: str = None):
136+
def write(self, filename: typing.Union[str, pathlib.Path] = None):
134137
'''Write authentication information.
135138
136139
Parameters:

0 commit comments

Comments
 (0)