Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2f2ed1f3
Commit
2f2ed1f3
authored
Oct 16, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ast_error_finish() and err_input(): filename can be NULL
Fix my previous commit (r85569).
parent
4c7c8c30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
Python/ast.c
Python/ast.c
+6
-1
Python/pythonrun.c
Python/pythonrun.c
+6
-1
No files found.
Python/ast.c
View file @
2f2ed1f3
...
...
@@ -131,7 +131,12 @@ ast_error_finish(const char *filename)
Py_INCREF
(
Py_None
);
loc
=
Py_None
;
}
filename_obj
=
PyUnicode_DecodeFSDefault
(
filename
);
if
(
filename
!=
NULL
)
filename_obj
=
PyUnicode_DecodeFSDefault
(
filename
);
else
{
Py_INCREF
(
Py_None
);
filename_obj
=
Py_None
;
}
if
(
filename_obj
!=
NULL
)
tmp
=
Py_BuildValue
(
"(NlOO)"
,
filename_obj
,
lineno
,
offset
,
loc
);
else
...
...
Python/pythonrun.c
View file @
2f2ed1f3
...
...
@@ -2054,7 +2054,12 @@ err_input(perrdetail *err)
errtext
=
PyUnicode_DecodeUTF8
(
err
->
text
,
strlen
(
err
->
text
),
"replace"
);
}
filename
=
PyUnicode_DecodeFSDefault
(
err
->
filename
);
if
(
err
->
filename
!=
NULL
)
filename
=
PyUnicode_DecodeFSDefault
(
err
->
filename
);
else
{
Py_INCREF
(
Py_None
);
filename
=
Py_None
;
}
if
(
filename
!=
NULL
)
v
=
Py_BuildValue
(
"(NiiN)"
,
filename
,
err
->
lineno
,
err
->
offset
,
errtext
);
...
...
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