mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Compatibility with PyPy
On PyPy, dict.__reversed__ exists and raises a TypeError, on CPython, it
doesn't.
However, reversed({}) behaves the same on both sides.
This commit is contained in:
parent
f88e5f836d
commit
c8a7ad36de
1 changed files with 6 additions and 2 deletions
|
|
@ -40,8 +40,12 @@ del _process_properties
|
|||
#
|
||||
# This basically checks whether the superclass of all icalendar classes has a
|
||||
# method from OrderedDict.
|
||||
ICALENDAR_ORIGINAL_ORDER_SUPPORT = \
|
||||
hasattr(icalendar.caselessdict.CaselessDict, '__reversed__')
|
||||
try:
|
||||
reversed(icalendar.caselessdict.CaselessDict())
|
||||
except TypeError:
|
||||
ICALENDAR_ORIGINAL_ORDER_SUPPORT = False
|
||||
else:
|
||||
ICALENDAR_ORIGINAL_ORDER_SUPPORT = True
|
||||
|
||||
|
||||
class Item(object):
|
||||
|
|
|
|||
Loading…
Reference in a new issue