Perform a weaker equality test if python-magic is not available