Update ext.py

Maybe I was using the code incorrectly but I was having problems running the following:

.. argparse::
    :module: mymod.somesubmod
    :func: main.get_argparser
    :prog: myprog

It seemed that the initial __import__ was returning a reference to "mymod" module and also getattr was unable to handle "main.get_argparser" because the function was an attribute of an attribute.

I am unable to push directly so I have typed in the edit manually. Need to test this later.