浏览代码

Dropped Python 2 support. Now Python 3 only.

Dan Helfman 8 年之前
父节点
当前提交
9212f87735
共有 6 个文件被更改,包括 8 次插入20 次删除
  1. 1 0
      NEWS
  2. 3 0
      README.md
  3. 1 7
      borgmatic/config.py
  4. 1 6
      borgmatic/tests/builtins.py
  5. 1 6
      borgmatic/tests/integration/test_config.py
  6. 1 1
      tox.ini

+ 1 - 0
NEWS

@@ -2,6 +2,7 @@
 
  * #18: Fix for README mention of sample files not included in package.
  * #22: Sample files for triggering borgmatic from a systemd timer.
+ * Dropped Python 2 support. Now Python 3 only.
  * Added logo.
 
 1.0.3

+ 3 - 0
README.md

@@ -59,6 +59,9 @@ To install borgmatic, run the following command to download and install it:
 
     sudo pip install --upgrade borgmatic
 
+Make sure you're using Python 3, as borgmatic does not support Python 2. (You
+may have to use "pip3" instead of "pip".)
+
 Then, download a [sample config
 file](https://torsion.org/hg/borgmatic/raw-file/tip/sample/config) and a
 [sample excludes

+ 1 - 7
borgmatic/config.py

@@ -1,11 +1,5 @@
 from collections import OrderedDict, namedtuple
-
-try:
-    # Python 2
-    from ConfigParser import RawConfigParser
-except ImportError:
-    # Python 3
-    from configparser import RawConfigParser
+from configparser import RawConfigParser
 
 
 Section_format = namedtuple('Section_format', ('name', 'options'))

+ 1 - 6
borgmatic/tests/builtins.py

@@ -3,9 +3,4 @@ import sys
 
 
 def builtins_mock():
-    try:
-        # Python 2
-        return flexmock(sys.modules['__builtin__'])
-    except KeyError:
-        # Python 3
-        return flexmock(sys.modules['builtins'])
+    return flexmock(sys.modules['builtins'])

+ 1 - 6
borgmatic/tests/integration/test_config.py

@@ -1,9 +1,4 @@
-try:
-    # Python 2
-    from cStringIO import StringIO
-except ImportError:
-    # Python 3
-    from io import StringIO
+from io import StringIO
 
 from collections import OrderedDict
 import string

+ 1 - 1
tox.ini

@@ -1,5 +1,5 @@
 [tox]
-envlist=py27,py34
+envlist=py34
 skipsdist=True
 
 [testenv]