Fix undefined function problem on windows

os.path.samefile is not implemented on Windows.  Try to replace it
with a path comparison.
Can you maybe introduce an inner function like this?
    
    def normalized(path):
        return os.path.abspath(os.path.normcase(os.path.normpath(path)))

Then the return becomes:

    return normalized(path1) == normalized(path2)