mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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
|
# This basically checks whether the superclass of all icalendar classes has a
|
||||||
# method from OrderedDict.
|
# method from OrderedDict.
|
||||||
ICALENDAR_ORIGINAL_ORDER_SUPPORT = \
|
try:
|
||||||
hasattr(icalendar.caselessdict.CaselessDict, '__reversed__')
|
reversed(icalendar.caselessdict.CaselessDict())
|
||||||
|
except TypeError:
|
||||||
|
ICALENDAR_ORIGINAL_ORDER_SUPPORT = False
|
||||||
|
else:
|
||||||
|
ICALENDAR_ORIGINAL_ORDER_SUPPORT = True
|
||||||
|
|
||||||
|
|
||||||
class Item(object):
|
class Item(object):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue