Browse Source

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
maruel@chromium.org 14 years ago
parent
commit
51c0ef015f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      breakpad.py

+ 2 - 2
breakpad.py

@@ -1,4 +1,4 @@
-# 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
 # found in the LICENSE file.
 
@@ -134,7 +134,7 @@ def Register():
 
 
 # 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
     (_HOST_NAME.endswith('.google.com') or
      _HOST_NAME.endswith('.chromium.org'))):