Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions hmrc/auth/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ def __post_init__(self, path):

# Open/create file if no explicit file was provided
if self.file is None:
if path is None:
path = os.path.expanduser('~/.hmrc.token')
fd = os.open(path, (os.O_RDWR | os.O_CREAT),
self.path = path
if self.path is None:
self.path = os.path.expanduser('~/.hmrc.token')
fd = os.open(self.path, (os.O_RDWR | os.O_CREAT),
(stat.S_IRUSR | stat.S_IWUSR))
self.file = open(fd, 'a+t', encoding='utf8')

Expand Down