Explorar o código

fix python 3.2 str.splitlines() compatibility issue

Thomas Waldmann %!s(int64=9) %!d(string=hai) anos
pai
achega
0c166898bf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      borg/remote.py

+ 1 - 1
borg/remote.py

@@ -265,7 +265,7 @@ class RemoteRepository:
                     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