Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
606f866a
Commit
606f866a
authored
Jan 13, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compile: allow empty filename
parent
3b0e42ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
src/codegen/codegen.cpp
src/codegen/codegen.cpp
+1
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+1
-1
test/tests/compile_test.py
test/tests/compile_test.py
+3
-0
No files found.
src/codegen/codegen.cpp
View file @
606f866a
...
...
@@ -116,7 +116,7 @@ SourceInfo::SourceInfo(BoxedModule* m, ScopingAnalysis* scoping, FutureFlags fut
ast
(
ast
),
cfg
(
NULL
),
body
(
std
::
move
(
body
))
{
assert
(
fn
->
size
()
);
assert
(
fn
);
// TODO: we should track this reference correctly rather than making it a root
gc
::
registerPermanentRoot
(
fn
,
true
);
this
->
fn
=
fn
;
...
...
src/runtime/objmodel.cpp
View file @
606f866a
...
...
@@ -2642,7 +2642,7 @@ extern "C" bool nonzero(Box* obj) {
||
obj
->
cls
==
capifunc_cls
||
obj
->
cls
==
builtin_function_or_method_cls
||
obj
->
cls
==
method_cls
||
obj
->
cls
==
frame_cls
||
obj
->
cls
==
generator_cls
||
obj
->
cls
==
capi_getset_cls
||
obj
->
cls
==
pyston_getset_cls
||
obj
->
cls
==
wrapperdescr_cls
||
obj
->
cls
==
wrapperobject_cls
,
||
obj
->
cls
==
wrapperobject_cls
||
obj
->
cls
==
code_cls
,
"%s.__nonzero__"
,
getTypeName
(
obj
));
// TODO
if
(
rewriter
.
get
())
{
...
...
test/tests/compile_test.py
View file @
606f866a
...
...
@@ -20,6 +20,9 @@ exec compile('print(1, 2)', 'test.py', 'exec')
tree
=
compile
(
'print(1, 2)'
,
'test.py'
,
'exec'
,
_ast
.
PyCF_ONLY_AST
)
exec
compile
(
tree
,
'<tree>'
,
'exec'
)
c
=
compile
(
'print(1, 2)'
,
''
,
'exec'
)
exec
c
print
(
c
.
co_name
,
c
.
co_filename
)
# test bad syntax which should not raise in compile time:
try
:
...
...
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