def strip_trailing_nl()

in Utilities/gyb.py [0:0]


def strip_trailing_nl(s):
    """If s ends with a newline, drop it; else return s intact"""
    return s[:-1] if s.endswith('\n') else s