# HG changeset patch # User Martin Geisler # Date 2009-05-20 08:50:23 # Node ID 22ec9cf4d0ceade8b1d511d8ff57307861a6bbf4 # Parent 6062c6362b2e318fbc731d3aa1211b662d70c191 util: use "is" for True/False/None comparisons diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -522,9 +522,9 @@ def system(cmd, environ={}, cwd=None, on exception.''' def py2shell(val): 'convert python object into string that is useful to shell' - if val in (None, False): + if val is None or val is False: return '0' - if val == True: + if val is True: return '1' return str(val) oldenv = {}