From 9212f877357ba4ca96138b6f771ecbf19b92a85f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 2 Jul 2017 17:18:33 -0700 Subject: [PATCH] Dropped Python 2 support. Now Python 3 only. --- NEWS | 1 + README.md | 3 +++ borgmatic/config.py | 8 +------- borgmatic/tests/builtins.py | 7 +------ borgmatic/tests/integration/test_config.py | 7 +------ tox.ini | 2 +- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index 3dc98c5b..91243605 100644 --- a/NEWS +++ b/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 diff --git a/README.md b/README.md index a8a0a032..7eb0eb1b 100644 --- a/README.md +++ b/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 diff --git a/borgmatic/config.py b/borgmatic/config.py index 36cb4f40..9c455b3e 100644 --- a/borgmatic/config.py +++ b/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')) diff --git a/borgmatic/tests/builtins.py b/borgmatic/tests/builtins.py index ff48f939..53970cde 100644 --- a/borgmatic/tests/builtins.py +++ b/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']) diff --git a/borgmatic/tests/integration/test_config.py b/borgmatic/tests/integration/test_config.py index e849b4f7..56cad6c3 100644 --- a/borgmatic/tests/integration/test_config.py +++ b/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 diff --git a/tox.ini b/tox.ini index 90c5ce21..579a9195 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py27,py34 +envlist=py34 skipsdist=True [testenv]