Commit e6b5e156 authored by Kirill Smelkov's avatar Kirill Smelkov

py2: *: No keyword argument after *argv

This feature is not supported on python2 -> emulate it by hand.
parent 5d52e1fc
......@@ -37,7 +37,9 @@ class Etx:
# UE represents one entry about an UE in ue_get[stats].ue_list .
class UE:
def __init__(ue, ue_id, tx, retx, *etxv, ri=1):
def __init__(ue, ue_id, tx, retx, *etxv, **kw):
ri = kw.pop('ri', 1)
assert not kw
for _ in etxv:
assert isinstance(_, Etx)
ue.ue_id = ue_id
......@@ -51,7 +53,10 @@ class UE:
# For easier testing and contrary to _Sampler collected samples are returned as
# a whole from final get, not incrementally.
class tSampler:
def __init__(t, *uev, use_bitsync=False, use_ri=False):
def __init__(t, *uev, **kw):
use_bitsync = kw.pop('use_bitsync', False)
use_ri = kw.pop('use_ri', False)
assert not kw
t.tstats = _tUEstats()
ue_stats0, stats0 = t.tstats.next(0, *uev)
t.sampler = _Sampler('zz', ue_stats0, stats0, use_bitsync=use_bitsync, use_ri=use_ri)
......@@ -160,7 +165,9 @@ def test_Sampler1():
# parts of the Sampler in how single flow is divided into samples. The other
# tests verify how Sampler handles other aspects - e.g. multiple erabs,
# multiple qci, etc...
def _(*tx_statsv, bitsync=None): # -> []Sample
def _(*tx_statsv, **kw): # -> []Sample
bitsync = kw.pop('bitsync', None)
assert not kw
def b(bitsync):
t = tSampler(use_bitsync=bitsync)
for (dt_tti, tx_bytes, tx, retx) in tx_statsv:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment