Y
Hacker News
new
|
ask
|
show
|
jobs
by
maple3142
771 days ago
The example given by parent does not need eval to trigger though. Just create a function and replace its code object then call it, it will easily segfault.
1 comments
jwilk
771 days ago
Complete example without eval:
def f(): pass f.__code__ = f.__code__.replace(co_consts=()) f()
link
Retr0id
771 days ago
yup, eval was just there for golfing purposes
link