Query about the __import__ function

Code:
~pwd
/home/preyan/test
~ls
sample.py
~python
>>> mod=__import__('sample')
>>> amod=__import__('/home/preyan/test/sample')
>>>
both the imports were fine but, when i did this

Code:
# /home/preyan/mypro.py
mod='sample'
os.chdir('/home/preyan/test')
module=__import__(mod)
...