The following (inserted after the ‘win = …’ block) might work - if you’re sure that you don’t want a visual indication when going out of range.
import psychopy.visual.shaders
fragFBOtoFrame = '''
uniform sampler2D texture;
void main() {
vec4 textureFrag = texture2D(texture,gl_TexCoord[0].st);
gl_FragColor.rgb = textureFrag.rgb;
}
'''
win._progFBOtoFrame = psychopy.visual.shaders.compileProgram(
psychopy.visual.shaders.vertSimple,
fragFBOtoFrame
)