]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Simplify string comparison using startswith()
authorSteve Holden <steve@holdenweb.com>
Wed, 2 Feb 2005 18:47:18 +0000 (18:47 +0000)
committerSteve Holden <steve@holdenweb.com>
Wed, 2 Feb 2005 18:47:18 +0000 (18:47 +0000)
Lib/bsddb/db.py

index b2ee14e53754e61547dc71c4137928094588fd2c..3bd0c8ba4e0a5d1923f778f6ba10a0fe896f824b 100644 (file)
@@ -37,7 +37,7 @@
 # case we ever want to augment the stuff in _db in any way.  For now
 # it just simply imports everything from _db.
 
-if __name__[:len('bsddb3.')] == 'bsddb3.':
+if __name__.startswith('bsddb3.'):
     # import _pybsddb binary as it should be the more recent version from
     # a standalone pybsddb addon package than the version included with
     # python as bsddb._bsddb.