Skip to content

Instantly share code, notes, and snippets.

@komorin0521
Created September 25, 2017 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komorin0521/46ba44b23ff11ec18ea3a5b575ad5f6d to your computer and use it in GitHub Desktop.
Save komorin0521/46ba44b23ff11ec18ea3a5b575ad5f6d to your computer and use it in GitHub Desktop.
pythonにおけるstackoverflow問題(Cannot recover from stack overflow) ref: http://qiita.com/komorin0521/items/9f2ea1e2a37fd7f13fe2
Fatal Python error: Cannot recover from stack overflow.
Current thread 0x00007f434f650700 (most recent call first):
File "***.py", line 4 in ...
File "***.py", line 7 in ...
File "***.py", line 7 in ...
...
def hoge()
try:
(正常処理)
except Exception as e:
(eの表示など)
hoge()
def hoge()
try:
(正常処理)
except Exception as e:
(eの表示など)
def main():
try:
while True:
hoge()
except Exception as e:
(eの表示など)
import sys
print(sys.getrecursionlimit()) # 再起呼び出しの最大値を表示 -> 1000
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment