Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'else:': 0.03; 'skip:f 70': 0.09; 'subject:parsing': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; '6:30': 0.16; 'list):': 0.16; 'none.': 0.16; '\xc2\xa0if': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'skip:f 30': 0.19; 'feb': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'skip:i 40': 0.24; 'cc:2**0': 0.24; '>': 0.26; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; "doesn't": 0.30; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'getting': 0.31; 'branches': 0.31; 'skip:i 60': 0.31; 'url:python': 0.33; 'level.': 0.33; 'subject:with': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'skip:f 40': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'error.': 0.37; 'skip:& 10': 0.38; 'pm,': 0.38; 'url:mail': 0.40; 'skip:\xc2 10': 0.60; 'skip:f 50': 0.65; 'to:addr:gmail.com': 0.65; '2015': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5SHwIW6cNfTV8ISu2z353+PV2sLuuKFBCDZmNaNPFwQ=; b=IAdKZOPz3gTaZYl3oDs46dHeGOqPERAPJE7eQtmvyHcsbJE9AfakjABAQpXuEwQcwD GS9cwbVqVgXnyjGW716rfPMkawd41YTPexeEZAOWNILh+1DHyeAwtK4uDMFIasFaMRtQ Ug5nxo/PxLAjuZYAbucVn2TIs7jNh0ylN0PFzh6LJKSfq+Y7C34w7RxzQxuVHI9eGU77 10tQuAII4XjK+Sl/T7PpicsnxK6Ma7DCi8m8qpw/uHep9kDa0YjBiDuwoajpZxi4z+m6 EvQu3dboO3Nhe+sBhmOA+N6sUlV4GuKJwq85ZmTjZZgfRBZ8tYq9jnoGmkvkmz+MyAky vCdg== MIME-Version: 1.0 X-Received: by 10.202.198.214 with SMTP id w205mr13601305oif.74.1423557027395; Tue, 10 Feb 2015 00:30:27 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Feb 2015 14:00:27 +0530 Subject: Re: Varable parsing error with python From: OmPs To: Chris Angelico Content-Type: multipart/alternative; boundary=001a1134f13eef7fac050eb7b2f6 Cc: python mail list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 77 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423557491 news.xs4all.nl 2853 [2001:888:2000:d::a6]:52284 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85440 --001a1134f13eef7fac050eb7b2f6 Content-Type: text/plain; charset=UTF-8 On 10 Feb 2015 13:59, "OmPs" wrote: > > > On 10 Feb 2015 13:12, "Chris Angelico" wrote: > > > > On Tue, Feb 10, 2015 at 6:30 PM, OmPs 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. > > > Tried that as well getting the same error. I feel its something to do with variable substitution. > > ChrisA > > -- > > https://mail.python.org/mailman/listinfo/python-list --001a1134f13eef7fac050eb7b2f6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 10 Feb 2015 13:59, "OmPs" <torque.india@gmail.com> wrote:
>
>
> On 10 Feb 2015 13:12, "Chris Angelico" <rosuav@gmail.com> wrote:
> >
> > On Tue, Feb 10, 2015 at 6:30 PM, OmPs <torque.india@gmail.com> wrote:
> > >=C2=A0 =C2=A0 =C2=A0def _getPackgeVersion(xmlfile, p):
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0package =3D str(p)
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if isinstance(fpmdict["= ;application"]["package"], list):
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for i in fpmd= ict["application"]["package"]:
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0if i["@name"] =3D=3D p:
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0_pkgVersion =3D i["version"]
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_pkgversion = =3D fpmdict["application"]["package"]["version&quo= t;]
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return _pkgVe= rsion
> >
> > One of your branches doesn't have a return statement in it, s= o Python
> > just returns None. You may want to unindent that return statement= one
> > level.
> >
> Tried that as well getting the same error.

I feel its something to do with variable substitution.

> > ChrisA
> > --
> > = https://mail.python.org/mailman/listinfo/python-list

--001a1134f13eef7fac050eb7b2f6--