def rmdir(path):
try:<EOL><INDENT>os.rmdir(path)<EOL><DEDENT>except OSError as exc:<EOL><INDENT>print(str(exc))<EOL><DEDENT>
Safe rmdir (non-recursive) which doesn't throw if the directory is not empty.