Put the

    # Python 2.7

and such on the line that the block starts (ie. line above, `try:`)

Same with the one below.