Skip to content

Commit de77229

Browse files
chore: fix the malfunction so the tests pass
1 parent 8116a97 commit de77229

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

juju/client/gocookies.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def py_to_go_cookie(py_cookie):
109109

110110

111111
def generate_rfc3339_from_unix_time(unix_time: datetime.datetime) -> str:
112-
rfc, discard = unix_time.isoformat().split(".")
112+
splitted_rfc = unix_time.isoformat().split(".")
113+
if len(splitted_rfc) == 1:
114+
return f"{splitted_rfc[0]}Z"
115+
rfc, discard = splitted_rfc
113116
discard = discard.split("+")
114117
if len(discard) > 1:
115118
rfc = datetime.datetime.fromisoformat(rfc)

0 commit comments

Comments
 (0)