Use isinstance() instead of type() (#7501) * Replace type comparisons with isinstance() checks. * Add changelog. (cherry picked from commit 48e860be20) Co-authored-by: Felix Fontein <felix@fontein.de>
48e860be20