fixing dict comprehension

/usr/local/lib/repomirror/repomirror/sync.py:361: UserWarning: The sync process for arch is locked with file /var/run/repomirror/arch.lck and PID 2981337.
  warnings.warn(warnmsg)
Traceback (most recent call last):
  File "/usr/local/bin/reposync", line 56, in <module>
    main()
  File "/usr/local/bin/reposync", line 51, in main
    r.sync()
  File "/usr/local/lib/repomirror/repomirror/sync.py", line 435, in sync
    distro.sync()
  File "/usr/local/lib/repomirror/repomirror/sync.py", line 363, in sync
    proc_info = {k.lstrip('_'):v for k, v in vars(proc) if k not in ('_lock', '_proc')}
  File "/usr/local/lib/repomirror/repomirror/sync.py", line 363, in <dictcomp>
    proc_info = {k.lstrip('_'):v for k, v in vars(proc) if k not in ('_lock', '_proc')}
ValueError: too many values to unpack (expected 2)
This commit is contained in:
brent s 2020-07-24 22:50:13 -04:00
parent a2e9075671
commit 3676acfc00
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -360,7 +360,7 @@ class Distro(object):
if not _is_cron:
warnings.warn(warnmsg)
if proc:
proc_info = {k.lstrip('_'):v for k, v in vars(proc) if k not in ('_lock', '_proc')}
proc_info = {k.lstrip('_'): v for k, v in vars(proc).items() if k not in ('_lock', '_proc')}
import pprint
print('Process information:')
pprint.pprint(proc_info)