![]() |
|
[Python] Function Returns None even though Return is stated - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Function Returns None even though Return is stated (/showthread.php?tid=5881639) |
Function Returns None even though Return is stated - The.Businessman - Sep 5, 2018 Code import requestsIt returns "None" Any idea what's the problem behind this ? RE: Function Returns None even though Return is stated - Dr. Lecter - Sep 5, 2018 The ss variable is not defined correctly. RE: Function Returns None even though Return is stated - The.Businessman - Sep 5, 2018 Thanks man, Changed Code with ss as requests.Session:Code with requests.Session() as ss:RE: Function Returns None even though Return is stated - michalmonday - Sep 5, 2018 I guess the main problem is that exception is being ignored, then the function returns nothing and the user can't investigate what actually went wrong. there's: Code try:You could replace it with: Code try: |