Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #85432

Re: Varable parsing error with python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'else:': 0.03; 'received:209.85.223': 0.03; 'subject:parsing': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; '6:30': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'list):': 0.16; 'none.': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'skip:f 30': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'skip:i 40': 0.24; 'cc:2**0': 0.24; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'branches': 0.31; 'level.': 0.33; 'subject:with': 0.35; 'received:209.85': 0.35; 'received:google.com': 0.35; 'skip:f 40': 0.36; 'received:209': 0.37; 'pm,': 0.38; '2015': 0.84; 'to:none': 0.92
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:cc :content-type; bh=/Q9A4zfHU/77MDqmv/b1crwjhPG6s2/EgxZ1WFwp0iU=; b=uJ+/09NW+UjjDuA49y7xeOsGIJ5g43SYjimlj++Wxe2Qzl/9w5PvG3/RoSRfWECRYE yHhMHNH/23qLc1/Q19ABfhWLlT393nUdyTq80H9DUC7heYxTrYHTg5u2i/0TDF18ZOWa HSgw4zdDlIVr8fIEGLydjjRLewO8bVQY2ls3GanmDVCruzwWZoVvr/H4fUrqVl4DiGVi BVycyxRkTwqIiNG67L7taf376EgN7STZ2Xn9uocS52je3NRp30WJzL2OAHTM0CzWJ74b 3Jr0aS8YNWZFTg4nETf4BiSUO1wXzyYlYw6mJ8M/xtY2lAQ3v1Kkvi57cBcjSQPPrQd9 rwoA==
MIME-Version 1.0
X-Received by 10.50.61.238 with SMTP id t14mr21861846igr.34.1423553982255; Mon, 09 Feb 2015 23:39:42 -0800 (PST)
In-Reply-To <CAFo8oMD+JZPuw3WedDOPDUo1+M+Qh-08rd57SfZneFFAG7u4mQ@mail.gmail.com>
References <CAFo8oMD+JZPuw3WedDOPDUo1+M+Qh-08rd57SfZneFFAG7u4mQ@mail.gmail.com>
Date Tue, 10 Feb 2015 18:39:42 +1100
Subject Re: Varable parsing error with python
From Chris Angelico <rosuav@gmail.com>
Cc python mail list <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18599.1423553990.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1423553990 news.xs4all.nl 2863 [2001:888:2000:d::a6]:51879
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 3681
X-Received-Body-CRC 4201913907
Xref csiph.com comp.lang.python:85432

Show key headers only | View raw


On Tue, Feb 10, 2015 at 6:30 PM, OmPs <torque.india@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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Varable parsing error with python Chris Angelico <rosuav@gmail.com> - 2015-02-10 18:39 +1100
  Re: Varable parsing error with python Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-10 18:24 +0000
    Re: Varable parsing error with python Dave Angel <davea@davea.name> - 2015-02-10 15:40 -0500

csiph-web