Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c40cdf72
Kaydet (Commit)
c40cdf72
authored
Eyl 18, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Once we're done with the sys module, remove it from the namespace so
this module is "import *" safe.
üst
691270fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
_exceptions.py
Lib/xml/sax/_exceptions.py
+11
-13
No files found.
Lib/xml/sax/_exceptions.py
Dosyayı görüntüle @
c40cdf72
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
import
sys
import
sys
if
sys
.
platform
[:
4
]
==
"java"
:
if
sys
.
platform
[:
4
]
==
"java"
:
from
java.lang
import
Exception
from
java.lang
import
Exception
del
sys
# ===== SAXEXCEPTION =====
# ===== SAXEXCEPTION =====
class
SAXException
(
Exception
):
class
SAXException
(
Exception
):
"""Encapsulate an XML error or warning. This class can contain
"""Encapsulate an XML error or warning. This class can contain
basic error or warning information from either the XML parser or
basic error or warning information from either the XML parser or
...
@@ -14,8 +15,8 @@ class SAXException(Exception):
...
@@ -14,8 +15,8 @@ class SAXException(Exception):
ErrorHandler interface, you are not actually required to throw
ErrorHandler interface, you are not actually required to throw
the exception; instead, you can simply read the information in
the exception; instead, you can simply read the information in
it."""
it."""
def
__init__
(
self
,
msg
,
exception
=
None
):
def
__init__
(
self
,
msg
,
exception
=
None
):
"""Creates an exception. The message is required, but the exception
"""Creates an exception. The message is required, but the exception
is optional."""
is optional."""
self
.
_msg
=
msg
self
.
_msg
=
msg
...
@@ -38,12 +39,12 @@ class SAXException(Exception):
...
@@ -38,12 +39,12 @@ class SAXException(Exception):
mistake, since Exception has __getitem__ defined."""
mistake, since Exception has __getitem__ defined."""
raise
NameError
(
"__getitem__"
)
raise
NameError
(
"__getitem__"
)
# ===== SAXPARSEEXCEPTION =====
# ===== SAXPARSEEXCEPTION =====
class
SAXParseException
(
SAXException
):
class
SAXParseException
(
SAXException
):
"""Encapsulate an XML parse error or warning.
"""Encapsulate an XML parse error or warning.
This exception will include information for locating the error in
This exception will include information for locating the error in
the original XML document. Note that although the application will
the original XML document. Note that although the application will
receive a SAXParseException as the argument to the handlers in the
receive a SAXParseException as the argument to the handlers in the
...
@@ -53,12 +54,12 @@ class SAXParseException(SAXException):
...
@@ -53,12 +54,12 @@ class SAXParseException(SAXException):
Since this exception is a subclass of SAXException, it inherits
Since this exception is a subclass of SAXException, it inherits
the ability to wrap another exception."""
the ability to wrap another exception."""
def
__init__
(
self
,
msg
,
exception
,
locator
):
def
__init__
(
self
,
msg
,
exception
,
locator
):
"Creates the exception. The exception parameter is allowed to be None."
"Creates the exception. The exception parameter is allowed to be None."
SAXException
.
__init__
(
self
,
msg
,
exception
)
SAXException
.
__init__
(
self
,
msg
,
exception
)
self
.
_locator
=
locator
self
.
_locator
=
locator
def
getColumnNumber
(
self
):
def
getColumnNumber
(
self
):
"""The column number of the end of the text where the exception
"""The column number of the end of the text where the exception
occurred."""
occurred."""
...
@@ -83,7 +84,7 @@ class SAXParseException(SAXException):
...
@@ -83,7 +84,7 @@ class SAXParseException(SAXException):
self
.
getLineNumber
(),
self
.
getLineNumber
(),
self
.
getColumnNumber
())
self
.
getColumnNumber
())
# ===== SAXNOTRECOGNIZEDEXCEPTION =====
# ===== SAXNOTRECOGNIZEDEXCEPTION =====
class
SAXNotRecognizedException
(
SAXException
):
class
SAXNotRecognizedException
(
SAXException
):
...
@@ -93,9 +94,9 @@ class SAXNotRecognizedException(SAXException):
...
@@ -93,9 +94,9 @@ class SAXNotRecognizedException(SAXException):
unrecognized feature or property. SAX applications and extensions may
unrecognized feature or property. SAX applications and extensions may
use this class for similar purposes."""
use this class for similar purposes."""
# ===== SAXNOTSUPPORTEDEXCEPTION =====
# ===== SAXNOTSUPPORTEDEXCEPTION =====
class
SAXNotSupportedException
(
SAXException
):
class
SAXNotSupportedException
(
SAXException
):
"""Exception class for an unsupported operation.
"""Exception class for an unsupported operation.
...
@@ -103,6 +104,3 @@ class SAXNotSupportedException(SAXException):
...
@@ -103,6 +104,3 @@ class SAXNotSupportedException(SAXException):
perform is requested (specifically setting a state or value). SAX
perform is requested (specifically setting a state or value). SAX
applications and extensions may use this class for similar
applications and extensions may use this class for similar
purposes."""
purposes."""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment