printing/printer: Raise AttributeError in a property
printing/printer: Raise AttributeError in a property

The hasattr() function is defined to call getattr() and see if an
exception is raised (in which case the attribute doesn't exist). This
has been changed in Python 3.2 to catch only AttributeErrors and not
all kinds of exceptions. See also issue #2608.

A property in printer.py checked for a key and so could raise a
KeyError, which now wouldn't be caught by hasattr(). Refactor to raise
an AttributeError if the key doesn't exist. This bug was caught by a
test in utilities/tests/test_pickling.

debugger22/sympy,mafiya69/sympy,grevutiu-gabriel/sympy,mafiya69/sympy,AkademieOlympia/sympy,VaibhavAgarwalVA/sympy,yashsharan/sympy,AunShiLord/sympy,ga7g08/sympy,cccfran/sympy,shipci/sympy,wanglongqi/sympy,skidzo/sympy,chaffra/sympy,drufat/sympy,amitjamadagni/sympy,hargup/sympy,meghana1995/sympy,asm666/sympy,Sumith1896/sympy,kmacinnis/sympy,AkademieOlympia/sympy,Sumith1896/sympy,Shaswat27/sympy,Gadal/sympy,drufat/sympy,chaffra/sympy,aktech/sympy,souravsingh/sympy,ahhda/sympy,kevalds51/sympy,jerli/sympy,moble/sympy,wanglongqi/sympy,jbbskinny/sympy,iamutkarshtiwari/sympy,jaimahajan1997/sympy,emon10005/sympy,garvitr/sympy,ChristinaZografou/sympy,pandeyadarsh/sympy,Mitchkoens/sympy,bukzor/sympy,Arafatk/sympy,mafiya69/sympy,Designist/sympy,sampadsaha5/sympy,Designist/sympy,moble/sympy,Davidjohnwilson/sympy,rahuldan/sympy,Curious72/sympy,skidzo/sympy,VaibhavAgarwalVA/sympy,atsao72/sympy,Designist/sympy,kaichogami/sympy,emon10005/sympy,liangjiaxing/sympy,MridulS/sympy,pandeyadarsh/sympy,ChristinaZografou/sympy,chaffra/sympy,abhiii5459/sympy,flacjacket/sympy,Gadal/sympy,Sumith1896/sympy,asm666/sympy,mcdaniel67/sympy,aktech/sympy,vipulroxx/sympy,cccfran/sympy,aktech/sympy,hrashk/sympy,kaushik94/sympy,kmacinnis/sympy,Arafatk/sympy,sunny94/temp,souravsingh/sympy,sahmed95/sympy,wyom/sympy,sahmed95/sympy,Vishluck/sympy,kumarkrishna/sympy,toolforger/sympy,cswiercz/sympy,MridulS/sympy,kumarkrishna/sympy,lidavidm/sympy,hrashk/sympy,lindsayad/sympy,rahuldan/sympy,VaibhavAgarwalVA/sympy,wanglongqi/sympy,emon10005/sympy,dqnykamp/sympy,Shaswat27/sympy,hargup/sympy,abhiii5459/sympy,saurabhjn76/sympy,iamutkarshtiwari/sympy,Titan-C/sympy,meghana1995/sympy,madan96/sympy,sampadsaha5/sympy,MechCoder/sympy,dqnykamp/sympy,drufat/sympy,atreyv/sympy,MechCoder/sympy,lindsayad/sympy,kaushik94/sympy,AkademieOlympia/sympy,yukoba/sympy,yashsharan/sympy,jamesblunt/sympy,ga7g08/sympy,hrashk/sympy,bukzor/sympy,maniteja123/sympy,sahilshekhawat/sympy,beni55/sympy,cswiercz/sympy,meghana1995/sympy,rahuldan/sympy,cswiercz/sympy,abloomston/sympy,shipci/sympy,srjoglekar246/sympy,pandeyadarsh/sympy,Curious72/sympy,lidavidm/sympy,mcdaniel67/sympy,jbbskinny/sympy,pbrady/sympy,ahhda/sympy,Mitchkoens/sympy,lindsayad/sympy,Vishluck/sympy,oliverlee/sympy,AunShiLord/sympy,sunny94/temp,kevalds51/sympy,grevutiu-gabriel/sympy,madan96/sympy,yukoba/sympy,farhaanbukhsh/sympy,amitjamadagni/sympy,skirpichev/omg,sampadsaha5/sympy,atsao72/sympy,hargup/sympy,garvitr/sympy,skidzo/sympy,wyom/sympy,abloomston/sympy,jerli/sympy,asm666/sympy,ChristinaZografou/sympy,shipci/sympy,saurabhjn76/sympy,oliverlee/sympy,Titan-C/sympy,mcdaniel67/sympy,ga7g08/sympy,jamesblunt/sympy,Shaswat27/sympy,Gadal/sympy,beni55/sympy,Arafatk/sympy,vipulroxx/sympy,postvakje/sympy,diofant/diofant,atreyv/sympy,pbrady/sympy,sahilshekhawat/sympy,sahilshekhawat/sympy,jaimahajan1997/sympy,Davidjohnwilson/sympy,lidavidm/sympy,kmacinnis/sympy,yukoba/sympy,garvitr/sympy,kevalds51/sympy,Curious72/sympy,kaichogami/sympy,toolforger/sympy,cccfran/sympy,beni55/sympy,sunny94/temp,Mitchkoens/sympy,atreyv/sympy,dqnykamp/sympy,kaushik94/sympy,atsao72/sympy,jaimahajan1997/sympy,grevutiu-gabriel/sympy,shikil/sympy,MridulS/sympy,oliverlee/sympy,yashsharan/sympy,jerli/sympy,souravsingh/sympy,AunShiLord/sympy,Titan-C/sympy,moble/sympy,iamutkarshtiwari/sympy,debugger22/sympy,kaichogami/sympy,pbrady/sympy,bukzor/sympy,MechCoder/sympy,toolforger/sympy,kumarkrishna/sympy,saurabhjn76/sympy,maniteja123/sympy,Vishluck/sympy,madan96/sympy,jamesblunt/sympy,postvakje/sympy,wyom/sympy,postvakje/sympy,Davidjohnwilson/sympy,shikil/sympy,liangjiaxing/sympy,ahhda/sympy,debugger22/sympy,vipulroxx/sympy,abloomston/sympy,shikil/sympy,abhiii5459/sympy,liangjiaxing/sympy,jbbskinny/sympy,farhaanbukhsh/sympy,farhaanbukhsh/sympy,maniteja123/sympy,sahmed95/sympy