浏览代码

chore: Drop FileNotFoundError handling for PY2

version-14
Gavin D'souza 4 年前
父节点
当前提交
eca30667d2
共有 2 个文件被更改,包括 1 次插入9 次删除
  1. +0
    -8
      frappe/exceptions.py
  2. +1
    -1
      frappe/model/delete_doc.py

+ 0
- 8
frappe/exceptions.py 查看文件

@@ -1,17 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt

import sys

# BEWARE don't put anything in this file except exceptions
from werkzeug.exceptions import NotFound


if sys.version_info.major == 2:
class FileNotFoundError(Exception): pass
else:
from builtins import FileNotFoundError

class SiteNotSpecifiedError(Exception):
def __init__(self, *args, **kwargs):
self.message = "Please specify --site sitename"


+ 1
- 1
frappe/model/delete_doc.py 查看文件

@@ -15,7 +15,7 @@ from frappe.utils.password import delete_all_passwords_for
from frappe.model.naming import revert_series_if_last
from frappe.utils.global_search import delete_for_document
from frappe.desk.doctype.tag.tag import delete_tags_for_document
from frappe.exceptions import FileNotFoundError

doctypes_to_skip = ("Communication", "ToDo", "DocShare", "Email Unsubscribe", "Activity Log", "File",
"Version", "Document Follow", "Comment" , "View Log", "Tag Link", "Notification Log", "Email Queue")


正在加载...
取消
保存