Commit a0a50ba9 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Remove support for Python 3.2.

It's a 4 year old version of Python and some libraries are no longer
supporting it anymore. This removes some hairy code to support Python
3.2 any longer.
parent 5092a3b9
......@@ -2,7 +2,6 @@ sudo: false # run on new infrastructure
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
......
......@@ -17,7 +17,6 @@
from six import u
import codecs
import re
import sys
import unittest
from topydo.lib.Config import config
......@@ -261,13 +260,10 @@ def replace_ical_tags(p_text):
return result
IS_PYTHON_32 = (sys.version_info.major, sys.version_info.minor) == (3, 2)
class ListCommandIcalTest(CommandTest):
def setUp(self):
self.maxDiff = None
@unittest.skipIf(IS_PYTHON_32, "icalendar is not supported for Python 3.2")
def test_ical(self):
todolist = load_file_to_todolist("test/data/ListCommandIcalTest.txt")
......@@ -283,21 +279,6 @@ class ListCommandIcalTest(CommandTest):
self.assertEqual(replace_ical_tags(self.output), replace_ical_tags(icaltext))
self.assertEqual(self.errors, "")
@unittest.skipUnless(IS_PYTHON_32, "icalendar is not supported for Python 3.2")
def test_ical_python32(self):
"""
Test case for Python 3.2 where icalendar is not supported.
"""
todolist = load_file_to_todolist("test/data/ListCommandTest.txt")
command = ListCommand(["-f", "ical"], todolist, self.out, self.error)
command.execute()
self.assertFalse(todolist.is_dirty())
self.assertEqual(self.output, '')
self.assertEqual(self.errors, "icalendar is not supported in this Python version.\n")
@unittest.skipIf(IS_PYTHON_32, "icalendar is not supported for Python 3.2")
def test_ical_unicode(self):
todolist = load_file_to_todolist("test/data/ListCommandUnicodeTest.txt")
......
......@@ -40,9 +40,6 @@ class ListCommand(ExpressionCommand):
"""
Attempts to import the icalendar package. Returns True if it
succeeds, otherwise False.
Raises a SyntaxError when icalendar couldn't be imported (most likely
under Python 3.2.
"""
try:
import icalendar as _
......@@ -50,8 +47,6 @@ class ListCommand(ExpressionCommand):
self.error("icalendar package is not installed.")
return False
# may also raise SyntaxError, but we'll deal with that in execute()
return True
def _process_flags(self):
......
......@@ -69,10 +69,7 @@ class IcalPrinter(Printer):
try:
import icalendar
self.icalendar = icalendar
except (SyntaxError, ImportError): # pragma: no cover
# icalendar does not support Python 3.2 resulting in a SyntaxError. Since
# this is an optional dependency, dropping Python 3.2 support altogether is
# too much. Therefore just disable the iCalendar functionality
except ImportError: # pragma: no cover
self.icalendar = None
def print_list(self, p_todos):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment