Commit 51c0ef01 authored by maruel@chromium.org's avatar maruel@chromium.org

Fix importing breakpad from an interactive python prompt.

When running an interactive python prompt, sys.modules['__main__'] has no
__file__ member.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8051027

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@103055 0039d316-1c4b-4281-b951-d872f2087c98
parent 064186cf
# Copyright (c) 2009 The Chromium Authors. All rights reserved. # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -134,7 +134,7 @@ def Register(): ...@@ -134,7 +134,7 @@ def Register():
# Skip unit tests and we don't want anything from non-googler. # Skip unit tests and we don't want anything from non-googler.
if (not 'test' in sys.modules['__main__'].__file__ and if (not 'test' in getattr(sys.modules['__main__'], '__file__', '') and
not 'NO_BREAKPAD' in os.environ and not 'NO_BREAKPAD' in os.environ and
(_HOST_NAME.endswith('.google.com') or (_HOST_NAME.endswith('.google.com') or
_HOST_NAME.endswith('.chromium.org'))): _HOST_NAME.endswith('.chromium.org'))):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment