Conversation
|
Hi @honzajavorek, what were your suggestions for utilizing the Scrapy's |
Is this really necessary? I would rather keep the same naming as in the JS version. I recall this argument from another PR, where @janbuchar disagreed with the shadowing being necessary? |
Not strictly necessary, just good practice and keeping the linter happy. However, the built-in exit is primarily for interactive use, so it's not that big deal, and keeping argument names consistent is a good argument (although the |
I am leaning towards |
In general, I'm pro-shadowing and will always argue in favor of shadowing obscure Python builtins 😁 However, |
|
I can't help myself, but the |
|
I have no problem changing to e.g. |
|
Let's go with |
call_exit optionexit_process option
|
LGTM. My idea was to use This change detects Scrapy by checking whether it's installed, which might not be perfect (perhaps I could use something from Scrapy, but not the whole thing? how many scrapers like that exists? probably not many 🤔 ), but the most important change is that if I realize the SDK doesn't do a great job in detecting my particular use case, I can now explicitly say "please do not call sys.exit()", no bizarre hacks needed. Thanks! This closes #389 as well. |
|
Thanks, @honzajavorek. I tried using |
Description
exit_processoption for the Actor class.exit_process(instead ofexit) to avoid shadowing Python's built-in names.Falsefor IPython, Pytest, and Scrapy environments, andTruefor all other cases.test_actor_logs_messages_correctlytest accordingly.Issues
sys.exithandling for tests inActor#396Tests