From f0fe282865bf8e10ed0571cbd71c1a8e2bdd67bc Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 4 Jan 2015 16:07:56 +0100 Subject: [PATCH] `props` might be an empty list, not None. --- vdirsyncer/storage/dav.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index 324c302..ccc3e01 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -433,10 +433,9 @@ class DavStorage(Storage): return href, etag def update(self, href, item, etag): - href = self._normalize_href(href) if etag is None: raise ValueError('etag must be given and must not be None.') - href, etag = self._put(href, item, etag) + href, etag = self._put(self._normalize_href(href), item, etag) return etag def upload(self, item): @@ -479,7 +478,7 @@ class DavStorage(Storage): continue props = response.findall('{DAV:}propstat/{DAV:}prop') - if props is None: + if not props: dav_logger.warning('Skipping {!r}, properties are missing.' .format(href)) continue