From: jean d. a. <jda...@gm...> - 2010-06-11 14:37:24
|
Hi Ludovic, just committed the following: def __checksyncbyte__(self): """Check validity of TS.""" if not 0x3b == self.bytes[0] and not 0x03f == self.bytes[0]: raise SmartcardException( 'invalid TS' + " 0x%-0.2x" % self.bytes[0] ) cheers, -jda On Fri, Jun 11, 2010 at 4:12 PM, Ludovic Rousseau < lud...@gm...> wrote: > 2010/6/7 Ludovic Rousseau <lud...@gm...>: > > 2010/6/7 jean daniel aussel <jda...@gm...>: > >> I have added three such classes, for AddReaderToGroupException, > >> RemoveReaderFromGroupException and IntroduceReaderException. Seen that > you > >> run pep8.py, guess I have to do it systematically for further commits. > > > > Yes, that would be nice to commit code that is PEP8 compliant. > > > > We still have a lot of "W602 deprecated form of raising exception" > > Many of the "raise" are in samples or test codes. > > Debian reported [1] only one exception: > python-pyscard_1.6.10-1 E string-literal-exception > /usr/share/pyshared/smartcard/ATR.py:41 > > The code is: > def __checksyncbyte__(self): > """Check validity of TS.""" > if not 0x3b == self.bytes[0] and not 0x03f == self.bytes[0]: > raise 'invalid TS', "0x%-0.2x" % self.bytes[0] > > What exception do you want to raise in that case? > Maybe add a new class in Exceptions.py and use it? > > Bye, > > [1] http://people.debian.org/~morph/strexp/string-exceptions.lintian<http://people.debian.org/%7Emorph/strexp/string-exceptions.lintian> > > -- > Dr. Ludovic Rousseau > |