The method for closing files in pytables is different before and after version 3.1.0. Added check and code for closing all files in versions of pytables < 3.1.0.