[mythtv-commits] Ticket #12982: python functions shouldn't be able to return single values or tuples
MythTV
noreply at mythtv.org
Tue Jan 24 13:30:41 UTC 2017
#12982: python functions shouldn't be able to return single values or tuples
--------------------------------------+-------------------------
Reporter: brian@… | Owner: wagnerrp
Type: Bug Report - General | Status: new
Priority: minor | Milestone: unknown
Component: Bindings - Python | Version: Master Head
Severity: medium | Keywords:
Ticket locked: 0 |
--------------------------------------+-------------------------
In
https://github.com/MythTV/mythtv/blob/master/mythtv/bindings/python/MythTV/methodheap.py
the {{{getSGList()}}} function can return either an integer or a list of
strings or a tuple of lists of strings.
How is a caller supposed to be able to deal with that? A caller will
typically want to do:
{{{
dirs,files,sizes = BE.getSGList(host, sg.groupname, sg.dirname)
}}}
But that will cause an exception when the return value is one of the -1,
or -2 values. -1 could be quite common for an empty SG for example so
it's not like it's even limited to error situations strictly.
I wonder how many other functions have this kind of problem.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12982>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list