Skip to content

Commit 19599b7

Browse files
committed
Rely on dict on Python 3.7 and later where ordering is guaranteed. Performance is better. Ref python/cpython#18540 (comment).
1 parent 3d17ee5 commit 19599b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

zipp.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
import zipfile
44
import itertools
55
import contextlib
6-
from collections import OrderedDict
6+
import sys
7+
8+
if sys.version_info < (3, 7):
9+
from collections import OrderedDict
10+
else:
11+
OrderedDict = dict
712

813

914
def _parents(path):

0 commit comments

Comments
 (0)