1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 08:45:13 +00:00

fix python 3.2 str.splitlines() compatibility issue

This commit is contained in:
Thomas Waldmann 2015-12-13 00:51:39 +01:00
parent 942120997e
commit 0c166898bf

View file

@ -265,7 +265,7 @@ def fetch_from_cache(args):
if not data:
raise ConnectionClosed()
data = data.decode('utf-8')
for line in data.splitlines(keepends=True):
for line in data.splitlines(True): # keepends=True for py3.3+
if line.startswith('$LOG '):
_, level, msg = line.split(' ', 2)
level = getattr(logging, level, logging.CRITICAL) # str -> int