Skip to content

Commit

Permalink
fixed tests for python 3.7. fixes #64
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Jan 3, 2019
1 parent 038f7a7 commit 680cb55
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mt940/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import re
import decimal
import datetime
import collections

# python 3.8+ compatibility
try: # pragma: no cover
from collections import abc
except ImportError: # pragma: no cover
import collections as abc

import mt940

Expand All @@ -18,8 +23,8 @@ class FixedOffset(datetime.tzinfo):
Source: https://docs.python.org/2/library/datetime.html#tzinfo-objects
>>> offset = FixedOffset(60)
>>> offset.utcoffset(None)
datetime.timedelta(0, 3600)
>>> offset.utcoffset(None).total_seconds()
3600.0
>>> offset.dst(None)
datetime.timedelta(0)
>>> offset.tzname(None)
Expand Down Expand Up @@ -214,7 +219,7 @@ def __str__(self):
self.date, )


class Transactions(collections.Sequence):
class Transactions(abc.Sequence):
'''
Collection of :py:class:`Transaction` objects with global properties such
as begin and end balance
Expand Down

0 comments on commit 680cb55

Please sign in to comment.