You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
Traceback (most recent call last): File "/home/marijn/Android/Sdk/ndk/25.1.8937393/prebuilt/linux-x86_64/bin/ndk-gdb.py", line 951, in <module> main() File "/home/marijn/Android/Sdk/ndk/25.1.8937393/prebuilt/linux-x86_64/bin/ndk-gdb.py", line 882, in main device.shell_nocheck(["run-as", pkg_name, "kill", "-9"] + kill_pids)TypeError: can only concatenate list (not "map") to listThis -gdb.py-gdb.pyis another Python 2 -> Python 3 conversion problem just like #1763:
#304
Closed
Gadgetflow7 opened this issue
Sep 28, 2022
· 1 comment
In Python 2, map() returns a list which you can freely concatenate to another list. In Python 3 map() returns a lazy map object (a generator) and can't be immediately concatenated to a list. Besides, map() is discouraged in favour of generator expressions, or in this specific case a list comprehension:
kill_pids= [str(pid) forpidinkill_pids]
EDIT: You can however also use some_list.extend(<iterable, i.e. generator>) to let the list iterate a generator and append every individual item to itself.
In Python 2, map() returns a list which you can freely concatenate to another list. In Python 3 map() returns a lazy map object (a generator) and can't be immediately concatenated to a list. Besides, map() is discouraged in favour of generator expressions, or in this specific case a list comprehension:
kill_pids= [str(pid) forpidinkill_pids]
EDIT: You can however also use some_list.extend(<iterable, i.e. generator>) to let the list iterate a generator and append every individual item to itself.
The current code is as follows:
In Python 2,
map()
returns a list which you can freely concatenate to another list. In Python 3map()
returns a lazymap
object (a generator) and can't be immediately concatenated to a list. Besides,map()
is discouraged in favour of generator expressions, or in this specific case a list comprehension:EDIT: You can however also use
some_list.extend(<iterable, i.e. generator>)
to let the list iterate a generator and append every individual item to itself.Originally posted by @MarijnS95 in android/ndk#1764 (comment)
The text was updated successfully, but these errors were encountered: