Vector component in Python cannot exceed 10 radians
I think the easy answer is just replace your actual rotation statements with an if statement that says something like the following:

up_pressed:

if armature.channels['Bone'].rotation_euler.y &lt; 2*math.pi:
    armature.channels['Bone'].rotation_euler.y = currentAngle + increment
else:
    armature.channels['Bone'].rotation_euler.y = 0


down_pressed:

if armature.channels['Bone'].rotation_euler.y &gt; 0:
    armature.channels['Bone'].rotation_euler.y = currentAngle - increment
else:
    armature.channels['Bone'].rotation_euler.y = 2*math.pi