]>
Commit | Line | Data |
---|---|---|
f33fa229 AM |
1 | diff --git a/pylib/gyp/common.py b/pylib/gyp/common.py |
2 | index b268d229..03c99cab 100644 | |
3 | --- a/pylib/gyp/common.py | |
4 | +++ b/pylib/gyp/common.py | |
5 | @@ -4,7 +4,6 @@ | |
6 | ||
7 | from __future__ import with_statement | |
8 | ||
9 | -import collections | |
10 | import errno | |
11 | import filecmp | |
12 | import os.path | |
13 | @@ -12,6 +11,11 @@ import re | |
14 | import tempfile | |
15 | import sys | |
16 | ||
17 | +try: | |
18 | + from collections.abc import MutableSet | |
19 | +except ImportError: | |
20 | + from collections import MutableSet | |
21 | + | |
22 | ||
23 | # A minimal memoizing decorator. It'll blow up if the args aren't immutable, | |
24 | # among other "problems". | |
25 | @@ -494,7 +498,7 @@ def uniquer(seq, idfun=None): | |
26 | ||
27 | ||
28 | # Based on http://code.activestate.com/recipes/576694/. | |
29 | -class OrderedSet(collections.MutableSet): | |
30 | +class OrderedSet(MutableSet): | |
31 | def __init__(self, iterable=None): | |
32 | self.end = end = [] | |
33 | end += [None, end, end] # sentinel node for doubly linked list | |
34 | diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py | |
35 | index 843e7067..327fe8d2 100644 | |
36 | --- a/pylib/gyp/generator/msvs.py | |
37 | +++ b/pylib/gyp/generator/msvs.py | |
38 | @@ -4,7 +4,7 @@ | |
39 | ||
40 | from __future__ import print_function | |
41 | ||
42 | -import collections | |
43 | +from collections import OrderedDict | |
44 | import copy | |
45 | import ntpath | |
46 | import os | |
47 | @@ -195,7 +195,7 @@ def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None, | |
48 | if not prefix: prefix = [] | |
49 | result = [] | |
50 | excluded_result = [] | |
51 | - folders = collections.OrderedDict() | |
52 | + folders = OrderedDict() | |
53 | # Gather files into the final result, excluded, or folders. | |
54 | for s in sources: | |
55 | if len(s) == 1: |