On Sat, 17 Dec 2016 21:11:42 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1481984790 -19800
> #      Sat Dec 17 19:56:30 2016 +0530
> # Node ID 4107888f9b89e178ab8369a6d63ebb2e17dc26b9
> # Parent  32865b15b8417a3ad673b72ffc713dffdebcd04a
> py3: replace os.sep with pycompat.ossep (part 1 of 4)

>  def endswithsep(path):
>      '''Check path ends with os.sep or os.altsep.'''
> -    return path.endswith(os.sep) or os.altsep and path.endswith(os.altsep)
> +    return path.endswith(pycompat.ossep) or os.altsep\
> +                        and path.endswith(os.altsep)

I want to keep the 'x and y' in the same line since it is stronger than 'or'.
Rewritten as:

    return (path.endswith(pycompat.ossep)
            or os.altsep and path.endswith(os.altsep))

BTW, we'll need pycompat.osaltsep.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to