replace use of 'a.find(b) != -1' --> 'b in a'
authorCampbell Barton <ideasman42@gmail.com>
Mon, 24 Jun 2013 05:55:05 +0000 (05:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 24 Jun 2013 05:55:05 +0000 (05:55 +0000)
build_files/buildbot/slave_test.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py

index f79ef7cf5c6a9d1cc5ca163c79bf216ac7a31673..d5acc8fd7a667b4be3be73e20ddebfb8a5ba5150 100644 (file)
@@ -31,7 +31,7 @@ builder = sys.argv[1]
 # we run from build/ directory
 blender_dir = '../blender'
 
-if builder.find('cmake') != -1:
+if "cmake" in builder:
     # cmake
     retcode = subprocess.call(['ctest', '.' '--output-on-failure'])
     sys.exit(retcode)
index 12ca16d480ad84144bd308fdcef9503d2d3f3657..f1597a66538e755dde0d5241e436d9d9054c0766 100644 (file)
@@ -3,13 +3,12 @@ import subprocess
 CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
 CL_STDOUT, CL_STDERR = CL_OUT.communicate()
 
-if CL_STDERR.find("17.00.") == -1:
-    VC_VERSION = '9.0'
-    LCGDIR = '#../lib/windows'
-    
-else:
+if "17.00." in CL_STDERR:
     VC_VERSION = '11.0'
     LCGDIR = '#../lib/windows_vc11'
+else:
+    VC_VERSION = '9.0'
+    LCGDIR = '#../lib/windows'
 
 LIBDIR = '${LCGDIR}'
 
index ab1c2a87d93234f7e557145b0c7a0358dd05c106..a13f417c36c70a2d3753bc94e65f11fc00947b9c 100644 (file)
@@ -3,13 +3,12 @@ import subprocess
 CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
 CL_STDOUT, CL_STDERR = CL_OUT.communicate()
 
-if CL_STDERR.find("17.00.") == -1:
-    VC_VERSION = '9.0'
-    LCGDIR = '#../lib/win64'
-    
-else:
+if "17.00." in CL_STDERR:
     VC_VERSION = '11.0'
     LCGDIR = '#../lib/win64_vc11'
+else:
+    VC_VERSION = '9.0'
+    LCGDIR = '#../lib/win64'
 
 LIBDIR = '${LCGDIR}'
 
index c6cb88faebc5c1cf858e6d09275fcfac565cd963..24bdd32ed2623c1f240bc227f6c4a8a38bc6fa10 100644 (file)
@@ -847,7 +847,7 @@ class BlenderEnvironment(SConsEnvironment):
 
         def list_substring(quickie, libname):
             for q in quickie:
-                if libname.find(q) != -1:
+                if q in libname:
                     return True
             return False
 
index 90674113f4735c8070e233667c2e94ebbd73e4af..53dd99a79713c16e207160a851774e8fddc47334 100644 (file)
@@ -674,10 +674,10 @@ def buildslave(target=None, source=None, env=None):
     if platform == 'linux':
         import platform
 
-        if env['BF_INSTALLDIR'].find('glibc27') != -1:
-            glibc="glibc27"
-        elif env['BF_INSTALLDIR'].find('glibc211') != -1:
-            glibc="glibc211"
+        if "glibc27" in env['BF_INSTALLDIR']:
+            glibc = "glibc27"
+        elif "glibc211" in env['BF_INSTALLDIR']:
+            glibc = "glibc211"
 
         bitness = platform.architecture()[0]
         if bitness == '64bit':