Varable parsing error with python

Chris Angelico rosuav at gmail.com
Tue Feb 10 02:39:42 EST 2015


On Tue, Feb 10, 2015 at 6:30 PM, OmPs <torque.india at gmail.com> wrote:
>     def _getPackgeVersion(xmlfile, p):
>         package = str(p)
>         if isinstance(fpmdict["application"]["package"], list):
>             for i in fpmdict["application"]["package"]:
>                 if i["@name"] == p:
>                     _pkgVersion = i["version"]
>         else:
>             _pkgversion = fpmdict["application"]["package"]["version"]
>             return _pkgVersion

One of your branches doesn't have a return statement in it, so Python
just returns None. You may want to unindent that return statement one
level.

ChrisA



More information about the Python-list mailing list