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
9eac7e76
Commit
9eac7e76
authored
Dec 16, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add '%r' format and some more pyconfig defines
parent
53d6a680
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
include/pyconfig.h
include/pyconfig.h
+5
-0
src/runtime/import.cpp
src/runtime/import.cpp
+4
-0
src/runtime/str.cpp
src/runtime/str.cpp
+6
-2
No files found.
include/pyconfig.h
View file @
9eac7e76
...
...
@@ -38,6 +38,11 @@
#define Py_UNICODE_SIZE 4
// Copied from a CPython ./configure run on a Linux machine:
// TODO copy these more systematically
#define HAVE_WAIT3 1
#define HAVE_WAIT4 1
#define HAVE_WAITPID 1
#define HAVE_ALLOCA_H 1
#define HAVE_ASM_TYPES_H 1
#define HAVE_CURSES_H 1
...
...
src/runtime/import.cpp
View file @
9eac7e76
...
...
@@ -192,6 +192,10 @@ static Box* import(const std::string* name, bool return_first) {
return
return_first
?
first_module
:
last_module
;
}
extern
"C"
PyObject
*
PyImport_ImportModuleNoBlock
(
const
char
*
name
)
{
Py_FatalError
(
"unimplemented"
);
}
// Named the same thing as the CPython method:
static
void
ensure_fromlist
(
Box
*
module
,
Box
*
fromlist
,
const
std
::
string
&
module_name
,
bool
recursive
)
{
if
(
module
->
getattr
(
"__path__"
)
==
NULL
)
{
...
...
src/runtime/str.cpp
View file @
9eac7e76
...
...
@@ -136,7 +136,7 @@ extern "C" Box* strMod(BoxedString* lhs, Box* rhs) {
}
os
<<
'%'
;
break
;
}
else
if
(
c
==
's'
)
{
}
else
if
(
c
==
's'
||
c
==
'r'
)
{
RELEASE_ASSERT
(
ndot
==
0
,
""
);
RELEASE_ASSERT
(
nzero
==
0
,
""
);
RELEASE_ASSERT
(
nspace
==
0
,
""
);
...
...
@@ -148,7 +148,11 @@ extern "C" Box* strMod(BoxedString* lhs, Box* rhs) {
elt_num
++
;
}
BoxedString
*
s
=
str
(
val_to_use
);
BoxedString
*
s
;
if
(
c
==
's'
)
s
=
str
(
val_to_use
);
else
s
=
repr
(
val_to_use
);
os
<<
s
->
s
;
break
;
}
else
if
(
c
==
'c'
)
{
...
...
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