anybody scripting skilled how to restrict frame range for multiple F-curves at once?
here it is working just fine:

import bpy

def mission1(obj):
if obj.animation_data is None or obj.animation_data.action is None:
    return

action = obj.animation_data.action

for fc in action.fcurves:
    print(fc.data_path)
    for mod in fc.modifiers:
        if mod.type == 'CYCLES':
            mod.frame_end = 303           
        mod.use_restricted_range = True

for obj in bpy.context.selected_objects:
mission1(obj)