Simply call math.copysign() with 1 as its first argument, casting to int if required:
math.copysign()
int
>>> math.copysign(1, -4) -1.0 >>> int(math.copysign(1, 5)) 1