test for non-empty parent_dir fixed.

Change from the pythonic if parent_dir from if parent_dir != "" resulted in the wrong boolean. Fixed.