Fixing logic error in showpy/listdir logic

Fixing Travis failure as well