Chromium Code Reviews| Index: tools/deep_memory_profiler/lib/ordered_dict.py |
| diff --git a/tools/deep_memory_profiler/lib/ordered_dict.py b/tools/deep_memory_profiler/lib/ordered_dict.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..11be63c1766fd297c9ab74305a905bae15a50eac |
| --- /dev/null |
| +++ b/tools/deep_memory_profiler/lib/ordered_dict.py |
| @@ -0,0 +1,19 @@ |
| +# Copyright 2013 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +# TODO(dmikurube): Remove this once Python 2.7 is required. |
|
peria
2013/07/16 10:30:11
Remove this *file*?
Dai Mikurube (NOT FULLTIME)
2013/07/16 10:42:39
Done.
|
| + |
| +import os |
| +import sys |
| + |
| +try: |
| + from collections import OrderedDict # pylint: disable=E0611,W0611 |
| +except ImportError: |
| + _BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| + _SIMPLEJSON_PATH = os.path.join(_BASE_PATH, |
| + os.pardir, |
| + os.pardir, |
| + 'third_party') |
| + sys.path.insert(0, _SIMPLEJSON_PATH) |
| + from simplejson import OrderedDict # pylint: disable=W0611 |