Sfoglia il codice sorgente

chore: Drop FileNotFoundError handling for PY2

version-14
Gavin D'souza 4 anni fa
parent
commit
eca30667d2
2 ha cambiato i file con 1 aggiunte e 9 eliminazioni
  1. +0
    -8
      frappe/exceptions.py
  2. +1
    -1
      frappe/model/delete_doc.py

+ 0
- 8
frappe/exceptions.py Vedi File

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


import sys

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



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

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


+ 1
- 1
frappe/model/delete_doc.py Vedi File

@@ -15,7 +15,7 @@ from frappe.utils.password import delete_all_passwords_for
from frappe.model.naming import revert_series_if_last from frappe.model.naming import revert_series_if_last
from frappe.utils.global_search import delete_for_document from frappe.utils.global_search import delete_for_document
from frappe.desk.doctype.tag.tag import delete_tags_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", doctypes_to_skip = ("Communication", "ToDo", "DocShare", "Email Unsubscribe", "Activity Log", "File",
"Version", "Document Follow", "Comment" , "View Log", "Tag Link", "Notification Log", "Email Queue") "Version", "Document Follow", "Comment" , "View Log", "Tag Link", "Notification Log", "Email Queue")


Caricamento…
Annulla
Salva