removing nested iffs

Josh Benner sjbenner at
Fri Jul 29 16:14:02 EDT 2011

On Fri, Jul 29, 2011 at 1:07 PM, Wolfgang Rohdewald
<wolfgang at>wrote:

> On Freitag 29 Juli 2011, Josh Benner wrote:
> > if not None:
> which python version understands this?
> --
> Wolfgang

Apparently the version running in my head understands it ;-)

Sorry about that how about this (replacing 'not' with 'is not' where

def format_rsync_src_string(args, server="RSYNC"):
    """ Format an rsync source directory string. """
    if args.server is None:
        raise CopyNightlyError("No rsync server provided.")
    src = "{0}::".format(args.server)
    if args.project is not None:
        src += "{0}/".format(args.project)
        if args.version is not None:
                src += "{0}/".format(args.version)
                if is not None:
                    src += "Build {0}".format(
    return src
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list