How to delete bone driver fmodifiergenerator my problem started when i tried to add a driver to a single bone in pose mode. That part is already solved and it was successful. The problem is 'that' script added an Fmodifiergenerator, i need your help to remove this generator with python in blender 2.74. I have seen another answers on this site on this subject. I tried it all and it doesnt work on my problem. I'm not looking for a fancy solution that will removed it from every bone in the armature, i'm just looking for a simple solution that will remove it from the specific bone that had been added with the driver_add script.
This is the script that i used to add the driver

#add driver
driver = bpy.context.object.pose.bones['Bone.001'].driver_add('rotation_euler', 2).driver

driver.type = "SCRIPTED"
#add variable
var = driver.variables.get("var", driver.variables.new())

var.name ='var'

Var.type = 'TRANSFORMS'

#add target

target = var.targets[0]

target.id = bpy.data.objects.get('armature.001')

target.bone_target = "bonectrl"

target.transform_space = 'TRANSFORM_SPACE'

target.transform_type = 'LOC_Z'

#add expression = "var*50"


Please help me.
Here is some commented console code using FCurveModifier.remove(...) I have a location.x driver on the context object's pose bone "Bone", which has an fcurve generator modifier.

&gt;&gt;&gt; driver = C.object.animation_data.drivers[0]
# driver 0 is driving location.x of pose bone "Bone"
&gt;&gt;&gt; driver.data_path
'pose.bones["Bone"].location'

&gt;&gt;&gt; driver.array_index
0
# if len(driver.modifiers) or somesuch
&gt;&gt;&gt; mod = driver.modifiers[0]
&gt;&gt;&gt; mod
bpy.data.objects['Armature']...FModifierGenerator
# yep it's a GENERATOR
&gt;&gt;&gt; mod.type
'GENERATOR'
# remove it.
&gt;&gt;&gt; driver.modifiers.remove(mod)