Ok. Thanks @efiring. I only did this because my editor was shouting at me that dirs was unused - the underscores use is not mentioned in PEP8 (though there is an interesting question on http://stackoverflow.com/questions/11486148/unused-variable-naming-in-python).