This fixes issue #19 by using the os.stat st_mode flag to determine if a file is a folder or not instead of relying on string handling of an exception message. This makes the code much more robust (just imagine if there was a file or folder named ENOENT involved in a completely unrelated error message) and solves the issue for all boards not requiring a special case for WiPy/LoPy. Will try to go over the rest of this code and do similar fixes tomorrow.
This fixes issue #19 by using the os.stat st_mode flag to determine if a file is a folder or not instead of relying on string handling of an exception message. This makes the code much more robust (just imagine if there was a file or folder named ENOENT involved in a completely unrelated error message) and solves the issue for all boards not requiring a special case for WiPy/LoPy. Will try to go over the rest of this code and do similar fixes tomorrow.