Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
8d3ce476
Commit
8d3ce476
authored
May 12, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for PyPy 7.3.1
parent
0506d010
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
1 deletion
+67
-1
src/gevent/libuv/_corecffi_cdef.c
src/gevent/libuv/_corecffi_cdef.c
+1
-0
src/gevent/libuv/_corecffi_source.c
src/gevent/libuv/_corecffi_source.c
+48
-0
src/gevent/testing/__init__.py
src/gevent/testing/__init__.py
+8
-0
src/gevent/testing/patched_tests_setup.py
src/gevent/testing/patched_tests_setup.py
+10
-1
No files found.
src/gevent/libuv/_corecffi_cdef.c
View file @
8d3ce476
...
@@ -395,3 +395,4 @@ static void gevent_zero_prepare(uv_prepare_t* handle);
...
@@ -395,3 +395,4 @@ static void gevent_zero_prepare(uv_prepare_t* handle);
static
void
gevent_zero_check
(
uv_check_t
*
handle
);
static
void
gevent_zero_check
(
uv_check_t
*
handle
);
static
void
gevent_zero_loop
(
uv_loop_t
*
handle
);
static
void
gevent_zero_loop
(
uv_loop_t
*
handle
);
static
void
gevent_set_uv_alloc
();
static
void
gevent_set_uv_alloc
();
static
void
gevent_test_setup
();
src/gevent/libuv/_corecffi_source.c
View file @
8d3ce476
...
@@ -132,6 +132,10 @@ static void gevent_zero_loop(uv_loop_t* handle)
...
@@ -132,6 +132,10 @@ static void gevent_zero_loop(uv_loop_t* handle)
memset
(
handle
,
0
,
sizeof
(
uv_loop_t
));
memset
(
handle
,
0
,
sizeof
(
uv_loop_t
));
}
}
/***
* Allocation functions
*/
#include "_ffi/alloc.c"
#include "_ffi/alloc.c"
static
void
*
_gevent_uv_malloc
(
size_t
size
)
static
void
*
_gevent_uv_malloc
(
size_t
size
)
...
@@ -169,6 +173,50 @@ static void gevent_set_uv_alloc()
...
@@ -169,6 +173,50 @@ static void gevent_set_uv_alloc()
_gevent_uv_free
);
_gevent_uv_free
);
}
}
/***
* Utility Functions
*/
#ifdef __APPLE__
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <pthread.h>
// based on code from libuv
static
void
gevent_move_pthread_to_realtime_scheduling_class
(
pthread_t
pthread
)
{
mach_timebase_info_data_t
timebase_info
;
mach_timebase_info
(
&
timebase_info
);
const
uint64_t
NANOS_PER_MSEC
=
1000000ULL
;
double
clock2abs
=
((
double
)
timebase_info
.
denom
/
(
double
)
timebase_info
.
numer
)
*
NANOS_PER_MSEC
;
thread_time_constraint_policy_data_t
policy
;
policy
.
period
=
0
;
policy
.
computation
=
(
uint32_t
)(
5
*
clock2abs
);
// 5 ms of work
policy
.
constraint
=
(
uint32_t
)(
10
*
clock2abs
);
policy
.
preemptible
=
FALSE
;
int
kr
=
thread_policy_set
(
pthread_mach_thread_np
(
pthread
),
THREAD_TIME_CONSTRAINT_POLICY
,
(
thread_policy_t
)
&
policy
,
THREAD_TIME_CONSTRAINT_POLICY_COUNT
);
if
(
kr
!=
KERN_SUCCESS
)
{
mach_error
(
"thread_policy_set:"
,
kr
);
exit
(
1
);
}
}
static
void
gevent_test_setup
()
{
gevent_move_pthread_to_realtime_scheduling_class
(
pthread_self
());
}
#else
static
void
gevent_test_setup
()
{}
#endif
#ifdef __clang__
#ifdef __clang__
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#pragma clang diagnostic push
#pragma clang diagnostic push
...
...
src/gevent/testing/__init__.py
View file @
8d3ce476
...
@@ -44,6 +44,14 @@ else:
...
@@ -44,6 +44,14 @@ else:
# for the same reasons as above.
# for the same reasons as above.
faulthandler
.
enable
()
faulthandler
.
enable
()
try
:
from
gevent.libuv
import
_corecffi
except
ImportError
:
pass
else
:
_corecffi
.
lib
.
gevent_test_setup
()
# pylint:disable=no-member
del
_corecffi
from
.sysinfo
import
VERBOSE
from
.sysinfo
import
VERBOSE
from
.sysinfo
import
WIN
from
.sysinfo
import
WIN
from
.sysinfo
import
LINUX
from
.sysinfo
import
LINUX
...
...
src/gevent/testing/patched_tests_setup.py
View file @
8d3ce476
...
@@ -601,7 +601,7 @@ if PY2:
...
@@ -601,7 +601,7 @@ if PY2:
'test_ssl.ContextTests.test_options'
,
'test_ssl.ContextTests.test_options'
,
]
]
if
PYPY
and
sys
.
pypy_version_info
[:
3
]
==
(
7
,
3
,
0
):
# pylint:disable=no-member
if
PYPY
and
sys
.
pypy_version_info
[:
2
]
==
(
7
,
3
):
# pylint:disable=no-member
if
OSX
:
if
OSX
:
disabled_tests
+=
[
disabled_tests
+=
[
...
@@ -613,6 +613,15 @@ if PYPY and sys.pypy_version_info[:3] == (7, 3, 0): # pylint:disable=no-member
...
@@ -613,6 +613,15 @@ if PYPY and sys.pypy_version_info[:3] == (7, 3, 0): # pylint:disable=no-member
'test_ssl.ThreadedTests.test_default_ecdh_curve'
,
'test_ssl.ThreadedTests.test_default_ecdh_curve'
,
]
]
if
PYPY3
and
TRAVIS
:
disabled_tests
+=
[
# If socket.SOCK_CLOEXEC is defined, this creates a socket
# and tests its type with ``sock.type & socket.SOCK_CLOEXEC``
# We have a ``@property`` for ``type`` that takes care of
# ``SOCK_NONBLOCK`` on Linux, but otherwise it's just a pass-through.
# This started failing with PyPy 7.3.1 and it's not clear why.
'test_socket.InheritanceTest.test_SOCK_CLOEXEC'
,
]
def
_make_run_with_original
(
mod_name
,
func_name
):
def
_make_run_with_original
(
mod_name
,
func_name
):
@
contextlib
.
contextmanager
@
contextlib
.
contextmanager
...
...
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