[Lldb-commits] [lldb] r251304 - Python3 - Change `dict.has_key(x)` to `x in dict`

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 26 09:50:51 PDT 2015


Author: zturner
Date: Mon Oct 26 11:50:51 2015
New Revision: 251304

URL: http://llvm.org/viewvc/llvm-project?rev=251304&view=rev
Log:
Python3 - Change `dict.has_key(x)` to `x in dict`

Modified:
    lldb/trunk/test/functionalities/tty/TestTerminal.py
    lldb/trunk/test/plugins/builder_base.py

Modified: lldb/trunk/test/functionalities/tty/TestTerminal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/tty/TestTerminal.py?rev=251304&r1=251303&r2=251304&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/tty/TestTerminal.py (original)
+++ lldb/trunk/test/functionalities/tty/TestTerminal.py Mon Oct 26 11:50:51 2015
@@ -25,7 +25,7 @@ class LaunchInTerminalTestCase(TestBase)
     @unittest2.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0, "test cannot be run as root")
     # Do we need to disable this test if the testsuite is being run on a remote system?
     # This env var is only defined when the shell is running in a local mac terminal window
-    @unittest2.skipUnless(os.environ.has_key('TERM_PROGRAM'), "test must be run on local system")
+    @unittest2.skipUnless('TERM_PROGRAM' in os.environ, "test must be run on local system")
     @no_debug_info_test
     def test_launch_in_terminal (self):
         exe = "/bin/ls"

Modified: lldb/trunk/test/plugins/builder_base.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/builder_base.py?rev=251304&r1=251303&r2=251304&view=diff
==============================================================================
--- lldb/trunk/test/plugins/builder_base.py (original)
+++ lldb/trunk/test/plugins/builder_base.py Mon Oct 26 11:50:51 2015
@@ -82,7 +82,7 @@ def getCmdLine(d):
 
     def setOrAppendVariable(k, v):
         append_vars = ["CFLAGS_EXTRAS", "LD_EXTRAS"]
-        if k in append_vars and os.environ.has_key(k):
+        if k in append_vars and k in os.environ:
             v = os.environ[k] + " " + v
         return pattern % (k, v)
     cmdline = " ".join([setOrAppendVariable(k, v) for k, v in list(d.items())])




More information about the lldb-commits mailing list