[#2171] Replace deprecated "sets" with modern "set".

I've no idea why this used sets. The use of it is relatively simple.

"sets" was deprecated since Python 2.6 
"set" was introduced in Python 2.4

I've checked that the tests have coverage of these two places.