Skip to content

Commit

Permalink
Update concurrent_scanner.py
Browse files Browse the repository at this point in the history
In Py3.x doing `dict.values()` returns a `dict_values` instance which does not allow index lookup. Have to convert it to a `list`

```python
>>> a = {'a':1, 'b':2}
>>> a.values()
dict_values([1, 2])
>>> a.values()[0]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    a.values()[0]
TypeError: 'dict_values' object does not support indexing
>>> list(a.values())[0]
1
>>> 
```
  • Loading branch information
gopar authored Oct 27, 2017
1 parent 4f479d8 commit 304904c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sslyze/concurrent_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _check_and_create_process(self, hostname):
else:
# We are already using the maximum number of processes
# Do not create a process and re-use a random existing hostname queue
self._hostname_queues_dict[hostname] = random.choice(self._hostname_queues_dict.values())
self._hostname_queues_dict[hostname] = random.choice(list(self._hostname_queues_dict.values()))
self._processes_dict[hostname] = []

else:
Expand Down

0 comments on commit 304904c

Please sign in to comment.