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
f9812cf8
Commit
f9812cf8
authored
Jul 23, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc things to try to get the warnings module to work
parent
e6103a1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+4
-1
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+3
-0
src/runtime/types.cpp
src/runtime/types.cpp
+4
-0
No files found.
src/runtime/builtin_modules/builtins.cpp
View file @
f9812cf8
...
@@ -371,7 +371,7 @@ BoxedModule* builtins_module;
...
@@ -371,7 +371,7 @@ BoxedModule* builtins_module;
// TODO looks like CPython and pypy put this into an "exceptions" module:
// TODO looks like CPython and pypy put this into an "exceptions" module:
BoxedClass
*
Exception
,
*
AssertionError
,
*
AttributeError
,
*
TypeError
,
*
NameError
,
*
KeyError
,
*
IndexError
,
*
IOError
,
BoxedClass
*
Exception
,
*
AssertionError
,
*
AttributeError
,
*
TypeError
,
*
NameError
,
*
KeyError
,
*
IndexError
,
*
IOError
,
*
OSError
,
*
ZeroDivisionError
,
*
ValueError
,
*
UnboundLocalError
,
*
RuntimeError
,
*
ImportError
,
*
StopIteration
;
*
OSError
,
*
ZeroDivisionError
,
*
ValueError
,
*
UnboundLocalError
,
*
RuntimeError
,
*
ImportError
,
*
StopIteration
,
*
Warning
;
const
ObjectFlavor
exception_flavor
(
&
boxGCHandler
,
NULL
);
const
ObjectFlavor
exception_flavor
(
&
boxGCHandler
,
NULL
);
Box
*
exceptionNew1
(
BoxedClass
*
cls
)
{
Box
*
exceptionNew1
(
BoxedClass
*
cls
)
{
...
@@ -459,6 +459,9 @@ void setupBuiltins() {
...
@@ -459,6 +459,9 @@ void setupBuiltins() {
RuntimeError
=
makeBuiltinException
(
Exception
,
"RuntimeError"
);
RuntimeError
=
makeBuiltinException
(
Exception
,
"RuntimeError"
);
ImportError
=
makeBuiltinException
(
Exception
,
"ImportError"
);
ImportError
=
makeBuiltinException
(
Exception
,
"ImportError"
);
StopIteration
=
makeBuiltinException
(
Exception
,
"StopIteration"
);
StopIteration
=
makeBuiltinException
(
Exception
,
"StopIteration"
);
Warning
=
makeBuiltinException
(
Exception
,
"Warning"
);
/*ImportWarning =*/
makeBuiltinException
(
Warning
,
"ImportWarning"
);
/*PendingDeprecationWarning =*/
makeBuiltinException
(
Warning
,
"PendingDeprecationWarning"
);
repr_obj
=
new
BoxedFunction
(
boxRTFunction
((
void
*
)
repr
,
UNKNOWN
,
1
));
repr_obj
=
new
BoxedFunction
(
boxRTFunction
((
void
*
)
repr
,
UNKNOWN
,
1
));
builtins_module
->
giveAttr
(
"repr"
,
repr_obj
);
builtins_module
->
giveAttr
(
"repr"
,
repr_obj
);
...
...
src/runtime/builtin_modules/sys.cpp
View file @
f9812cf8
...
@@ -87,6 +87,9 @@ void setupSys() {
...
@@ -87,6 +87,9 @@ void setupSys() {
sys_module
->
giveAttr
(
"stdout"
,
new
BoxedFile
(
stdout
));
sys_module
->
giveAttr
(
"stdout"
,
new
BoxedFile
(
stdout
));
sys_module
->
giveAttr
(
"stdin"
,
new
BoxedFile
(
stdin
));
sys_module
->
giveAttr
(
"stdin"
,
new
BoxedFile
(
stdin
));
sys_module
->
giveAttr
(
"stderr"
,
new
BoxedFile
(
stderr
));
sys_module
->
giveAttr
(
"stderr"
,
new
BoxedFile
(
stderr
));
sys_module
->
giveAttr
(
"warnoptions"
,
new
BoxedList
());
sys_module
->
giveAttr
(
"py3kwarning"
,
False
);
}
}
void
setupSysEnd
()
{
void
setupSysEnd
()
{
...
...
src/runtime/types.cpp
View file @
f9812cf8
...
@@ -75,6 +75,8 @@ extern "C" BoxedFunction::BoxedFunction(CLFunction* f)
...
@@ -75,6 +75,8 @@ extern "C" BoxedFunction::BoxedFunction(CLFunction* f)
this
->
giveAttr
(
"__module__"
,
modname
);
this
->
giveAttr
(
"__module__"
,
modname
);
}
}
this
->
giveAttr
(
"__doc__"
,
None
);
assert
(
f
->
num_defaults
==
ndefaults
);
assert
(
f
->
num_defaults
==
ndefaults
);
}
}
...
@@ -97,6 +99,8 @@ extern "C" BoxedFunction::BoxedFunction(CLFunction* f, std::initializer_list<Box
...
@@ -97,6 +99,8 @@ extern "C" BoxedFunction::BoxedFunction(CLFunction* f, std::initializer_list<Box
this
->
giveAttr
(
"__module__"
,
modname
);
this
->
giveAttr
(
"__module__"
,
modname
);
}
}
this
->
giveAttr
(
"__doc__"
,
None
);
assert
(
f
->
num_defaults
==
ndefaults
);
assert
(
f
->
num_defaults
==
ndefaults
);
}
}
...
...
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