Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
61ea6032
Commit
61ea6032
authored
Mar 16, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change exceptions to store lineno and offset info in separate attributes,
for consistency with nsgmllib and expat.
parent
a476259a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
lib/python/TAL/TALDefs.py
lib/python/TAL/TALDefs.py
+9
-7
No files found.
lib/python/TAL/TALDefs.py
View file @
61ea6032
...
...
@@ -111,16 +111,18 @@ KNOWN_TAL_ATTRIBUTES = [
]
class
TALError
(
Exception
):
def
__init__
(
self
,
msg
,
position
=
None
):
def
__init__
(
self
,
msg
,
position
=
(
None
,
None
)):
assert
msg
!=
""
self
.
msg
=
msg
self
.
position
=
position
# (line, offset) pair
self
.
lineno
=
position
[
0
]
self
.
offset
=
position
[
1
]
def
__str__
(
self
):
if
self
.
position
:
result
=
"%s, at line %d, column %d"
%
(
self
.
msg
,
self
.
position
[
0
],
self
.
position
[
1
]
+
1
)
els
e
:
result
=
self
.
msg
result
=
self
.
msg
if
self
.
lineno
is
not
None
:
result
=
result
+
", at line %d"
%
self
.
lineno
if
self
.
offset
is
not
Non
e
:
result
=
result
+
", column %d"
%
(
self
.
offset
+
1
)
return
result
class
METALError
(
TALError
):
...
...
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