While the previous way worked. This is more correct. relpath needs to have matching types and this function assumes it gets a string/unicode. However, relpath will sometimes return a binary type. This happens because sometimes it returns a hardcoded value. See posixpath.py in python27. These hardcoded values are not unicode in python2.
Merge branch 'add-python3' of github.com:Bachmann1234/diff-cover into add-python3