From 3d2e3e7db39a2a197194d27dff0a7894e1f3cf28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 3 Aug 2018 11:39:55 +0200 Subject: [PATCH] Fix python3.7 incompatibilities in SnapshotProvider --- lib/tfw/components/snapshot_provider.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tfw/components/snapshot_provider.py b/lib/tfw/components/snapshot_provider.py index aa9bb1f..f0cd6ba 100644 --- a/lib/tfw/components/snapshot_provider.py +++ b/lib/tfw/components/snapshot_provider.py @@ -8,6 +8,8 @@ from os.path import isdir from datetime import datetime from uuid import uuid4 +from dateutil import parser as dateparser + class SnapshotProvider: def __init__(self, directory, git_dir): @@ -109,7 +111,7 @@ class SnapshotProvider: self._snapshot() def _checkout_new_branch_from_head(self): - branch_name = uuid4() + branch_name = str(uuid4()) self._run(( 'git', 'branch', branch_name @@ -174,7 +176,7 @@ class SnapshotProvider: commit_hash, timestamp = line.split('@') commits.append({ 'hash': commit_hash, - 'timestamp': datetime.fromisoformat(timestamp) + 'timestamp': dateparser.parse(timestamp) }) return commits