Skip to content

Commit 4525c22

Browse files
committed
Remove Python 2.6 compatibility hack
- Legacy-Id: 7156
1 parent 1ab82bd commit 4525c22

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

ietf/sync/rfceditor.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
MIN_QUEUE_RESULTS = 10
1919
MIN_INDEX_RESULTS = 5000
2020

21-
# Python < 2.7 doesn't have the total_seconds method on datetime.timedelta.
22-
def total_seconds(td):
23-
return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
24-
2521
def get_child_text(parent_node, tag_name):
2622
for node in parent_node.childNodes:
2723
if node.nodeType == Node.ELEMENT_NODE and node.localName == tag_name:
@@ -387,7 +383,7 @@ def update_docs_from_rfc_index(data, skip_older_than_date=None):
387383
if abs(d - synthesized) > datetime.timedelta(days=60):
388384
synthesized = d
389385
else:
390-
direction = -1 if total_seconds(d - synthesized) < 0 else +1
386+
direction = -1 if (d - synthesized).total_seconds() < 0 else +1
391387
while synthesized.month != d.month or synthesized.year != d.year:
392388
synthesized += datetime.timedelta(days=direction)
393389
e.time = synthesized

0 commit comments

Comments
 (0)