R. David Murray added the comment: By the way, you could write this as: localist = os.listdir(path if path else '.') ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue17545> _______________________________________