[Akshita Jha]
> This error occurs wherever "if sprosp['license'] == ' ' " is
> checked. I solved these errors by using try-except block:
>
> try:
> if sprosp['license'] == '':
> sprosp['license'] = 'free'
> except KeyError:
> sprosp['license'] = 'free'
Instead of a try/except block for this, I would suggest to use the 'in'
check like this:
if 'license' not in sprosp or sprosp['license'] == '':
sprosp['license'] = 'free'
I find it easier to understand and it avoid the exception overhead.
--
Happy hacking
Petter Reinholdtsen
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]