Fix crash when running under python3.
commitc819a5a033bf26fa7a90a627ac69e0d1891b0c43
authorPaul Wise <pabs3@bonedaddy.net>
Wed, 5 Dec 2012 05:43:36 +0000 (5 13:43 +0800)
committerGuillaume Chazarain <guichaz@gmail.com>
Sun, 16 Dec 2012 17:43:47 +0000 (16 18:43 +0100)
tree1985662cfa6839e85a486ff176ec17abaec5a707
parent6baee990bb7784e64aa6e3df0e46f2b876794524
Fix crash when running under python3.

This reverts cd6ffb5913664844290f44a7ea48533caf8c459e

Traceback (most recent call last):
  File "./iotop.py", line 12, in <module>
    main()
  File "./iotop/iotop/ui.py", line 597, in main
    main_loop()
  File "./iotop/iotop/ui.py", line 587, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "./iotop/iotop/ui.py", line 485, in run_iotop
    return curses.wrapper(run_iotop_window, options)
  File "/usr/lib/python3.2/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "./iotop/iotop/ui.py", line 478, in run_iotop_window
    ui.run()
  File "./iotop/iotop/ui.py", line 153, in run
    total = self.process_list.refresh_processes()
  File "./iotop/iotop/data.py", line 459, in refresh_processes
    self.processes.items() if
  File "./iotop/iotop/data.py", line 460, in <listcomp>
    process.update_stats()])
  File "./iotop/iotop/data.py", line 358, in update_stats
    for tid, thread in self.threads.items():
RuntimeError: dictionary changed size during iteration

[This is valid since 0fc4ab84c8cbba1fbe83dc71fb89100b87c54898
 added the self.threads = dict(...)]
iotop/data.py