replaced deprecated BaseException
updated print statement
fixed print statement
fixed print statement
removed deprecated while 1:
Update advanced.rst
fixed print statement
fixed print statement
back to BaseException
Merge pull request #1654 from riyadparvez/deprecation-removal

Deprecation removal and other idiomatic updates