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
3a5b3e50
Commit
3a5b3e50
authored
Jun 08, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #591 from kmod/debugging
Specify all package versions in virtualenv_test
parents
66592930
2f4688eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
src/codegen/parser.cpp
src/codegen/parser.cpp
+15
-8
test/integration/virtualenv_test.py
test/integration/virtualenv_test.py
+9
-1
No files found.
src/codegen/parser.cpp
View file @
3a5b3e50
...
...
@@ -1122,6 +1122,7 @@ AST_Module* caching_parse_file(const char* fn) {
return
parse_file
(
fn
);
}
static
const
int
MAX_TRIES
=
5
;
std
::
vector
<
char
>
file_data
;
int
tries
=
0
;
...
...
@@ -1138,8 +1139,11 @@ AST_Module* caching_parse_file(const char* fn) {
file_data
.
push_back
(
buf
[
i
]);
if
(
read
==
0
)
{
if
(
ferror
(
fp
))
if
(
ferror
(
fp
))
{
if
(
tries
==
MAX_TRIES
)
fprintf
(
stderr
,
"Error reading %s: %s
\n
"
,
cache_fn
.
c_str
(),
strerror
(
errno
));
good
=
false
;
}
break
;
}
}
...
...
@@ -1153,8 +1157,8 @@ AST_Module* caching_parse_file(const char* fn) {
if
(
good
)
{
if
(
strncmp
(
&
file_data
[
0
],
getMagic
(),
MAGIC_STRING_LENGTH
)
!=
0
)
{
if
(
VERBOSITY
())
{
printf
(
"Warning: corrupt or non-Pyston .pyc file found; ignoring
\n
"
);
if
(
VERBOSITY
()
||
tries
==
MAX_TRIES
)
{
fprintf
(
stderr
,
"Warning: corrupt or non-Pyston .pyc file found; ignoring
\n
"
);
}
good
=
false
;
}
...
...
@@ -1168,8 +1172,8 @@ AST_Module* caching_parse_file(const char* fn) {
int
expected_total_length
=
MAGIC_STRING_LENGTH
+
LENGTH_LENGTH
+
CHECKSUM_LENGTH
+
length
;
if
(
expected_total_length
!=
file_data
.
size
())
{
if
(
VERBOSITY
())
{
printf
(
"Warning: truncated .pyc file found; ignoring
\n
"
);
if
(
VERBOSITY
()
||
tries
==
MAX_TRIES
)
{
fprintf
(
stderr
,
"Warning: truncated .pyc file found; ignoring
\n
"
);
}
good
=
false
;
}
else
{
...
...
@@ -1188,8 +1192,8 @@ AST_Module* caching_parse_file(const char* fn) {
}
if
(
checksum
!=
0
)
{
if
(
VERBOSITY
())
printf
(
"pyc checksum failed!
\n
"
);
if
(
VERBOSITY
()
||
tries
==
MAX_TRIES
)
fprintf
(
stderr
,
"pyc checksum failed!
\n
"
);
good
=
false
;
}
}
...
...
@@ -1204,12 +1208,15 @@ AST_Module* caching_parse_file(const char* fn) {
assert
(
rtn
->
type
==
AST_TYPE
::
Module
);
return
ast_cast
<
AST_Module
>
(
rtn
);
}
if
(
tries
==
MAX_TRIES
)
fprintf
(
stderr
,
"Returned NULL module?
\n
"
);
good
=
false
;
}
assert
(
!
good
);
tries
++
;
RELEASE_ASSERT
(
tries
<=
5
,
"repeatedly failing to parse file"
);
RELEASE_ASSERT
(
tries
<=
MAX_TRIES
,
"repeatedly failing to parse file"
);
if
(
!
good
)
{
assert
(
!
fp
);
file_data
.
clear
();
...
...
test/integration/virtualenv_test.py
View file @
3a5b3e50
...
...
@@ -21,7 +21,15 @@ set -e
set -ux
python -c 'import __future__'
python -c 'import sys; print sys.executable'
pip install bcrypt==1.1.0 python-gflags==2.0 sqlalchemy==1.0.0 Pillow==2.8.1 decorator==3.4.2 oauth2client==1.4.11
# The first entry of each line is the main thing we're testing; the rest are dependencies.
# List the dependencies explicitly so that we can enforce specific revisions; these were the
# versions that got installed as of 6/5/15
pip install bcrypt==1.1.0 cffi==1.1.0 six==1.9.0 pycparser==2.13
pip install python-gflags==2.0
pip install sqlalchemy==1.0.0
pip install Pillow==2.8.1
pip install decorator==3.4.2
pip install oauth2client==1.4.11 httplib2==0.9.1 pyasn1==0.1.7 pyasn1-modules==0.0.5 rsa==3.1.4
python -c 'import bcrypt; assert bcrypt.__version__ == "1.1.0"; assert bcrypt.hashpw("password1", "$2a$12$0123456789012345678901").endswith("I1hdtg4K"); print "bcrypt seems to work"'
python -c 'import gflags; print "gflags imports"'
python -c 'import sqlalchemy; print "sqlalchemy imports"'
...
...
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