| OLD | NEW |
| 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 # This file contains a set of utilities functions used by other Python-based | 5 # This file contains a set of utilities functions used by other Python-based |
| 6 # scripts. | 6 # scripts. |
| 7 | 7 |
| 8 import commands | 8 import commands |
| 9 import contextlib | 9 import contextlib |
| 10 import datetime | 10 import datetime |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 import winreg | 988 import winreg |
| 989 except ImportError: | 989 except ImportError: |
| 990 import _winreg as winreg | 990 import _winreg as winreg |
| 991 for wowbit in [winreg.KEY_WOW64_64KEY, winreg.KEY_WOW64_32KEY]: | 991 for wowbit in [winreg.KEY_WOW64_64KEY, winreg.KEY_WOW64_32KEY]: |
| 992 try: | 992 try: |
| 993 with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, | 993 with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, |
| 994 WindowsCoredumpEnabler.IMGEXEC_NAME, | 994 WindowsCoredumpEnabler.IMGEXEC_NAME, |
| 995 0, | 995 0, |
| 996 winreg.KEY_READ | wowbit) as handle: | 996 winreg.KEY_READ | wowbit) as handle: |
| 997 raise Exception( | 997 raise Exception( |
| 998 "Found werfault.exe was disabled. Probably by puppet. Too bad") | 998 "Found werfault.exe was disabled. Probably by puppet. Too bad! " |
| 999 "(For more information see https://crbug.com/691971)") |
| 999 except OSError: | 1000 except OSError: |
| 1000 # If the open did not work the werfault.exe execution setting is as it | 1001 # If the open did not work the werfault.exe execution setting is as it |
| 1001 # should be. | 1002 # should be. |
| 1002 pass | 1003 pass |
| 1003 | 1004 |
| 1004 if throw: | 1005 if throw: |
| 1005 missing_as_string = ', '.join([str(c) for c in missing]) | 1006 missing_as_string = ', '.join([str(c) for c in missing]) |
| 1006 raise Exception('Missing crash dumps for: %s' % missing_as_string) | 1007 raise Exception('Missing crash dumps for: %s' % missing_as_string) |
| 1007 | 1008 |
| 1008 @contextlib.contextmanager | 1009 @contextlib.contextmanager |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1024 return contextlib.nested(WindowsCoredumpEnabler(), | 1025 return contextlib.nested(WindowsCoredumpEnabler(), |
| 1025 WindowsCoreDumpArchiver()) | 1026 WindowsCoreDumpArchiver()) |
| 1026 else: | 1027 else: |
| 1027 # We don't have support for MacOS yet. | 1028 # We don't have support for MacOS yet. |
| 1028 assert osname == 'macos' | 1029 assert osname == 'macos' |
| 1029 return NooptCoreDumpArchiver() | 1030 return NooptCoreDumpArchiver() |
| 1030 | 1031 |
| 1031 if __name__ == "__main__": | 1032 if __name__ == "__main__": |
| 1032 import sys | 1033 import sys |
| 1033 Main() | 1034 Main() |
| OLD | NEW |