標準ライブラリのエラー処理の既存のバグのパッチに取り組んでおり、次のshutil.rmtree()
コードに遭遇しました。
try:
orig_st = os.lstat(path)
except Exception:
onerror(os.lstat, path, sys.exc_info())
return
try:
fd = os.open(path, os.O_RDONLY)
except Exception:
onerror(os.lstat, path, sys.exc_info())
return
実装を容易にするために変更を適用する前に、次のように単純化したいと思います。
try:
orig_st = os.lstat(path)
fd = os.open(path, os.O_RDONLY)
except Exception:
onerror(os.lstat, path, sys.exc_info())
return
2 つのコード サンプル間で動作が異なる場合はありますか?