File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
graalpython/lib-graalpython/patches/tokenizers Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ [[rules ]]
2
+ version = ' >= 0.19'
3
+ patch = ' tokenizers-0.19-plus.patch'
4
+ license = ' Apache-2.0'
5
+
1
6
[[rules ]]
2
7
version = ' == 0.13.3'
3
8
patch = ' tokenizers-0.13.3.patch'
Original file line number Diff line number Diff line change
1
+ diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs
2
+ index 3f1e713..6dd3c72 100644
3
+ --- a/bindings/python/src/lib.rs
4
+ +++ b/bindings/python/src/lib.rs
5
+ @@ -50,14 +50,16 @@ extern "C" fn child_after_fork() {
6
+ pub fn tokenizers(m: &Bound<'_, PyModule>) -> PyResult<()> {
7
+ let _ = env_logger::try_init_from_env("TOKENIZERS_LOG");
8
+
9
+ + // GraalPy change: Disable the atfork warning. This triggers a ton of false positives when
10
+ + // jline calls stty and we don't support fork anyway
11
+ // Register the fork callback
12
+ - #[cfg(target_family = "unix")]
13
+ - unsafe {
14
+ - if !REGISTERED_FORK_CALLBACK {
15
+ - libc::pthread_atfork(None, None, Some(child_after_fork));
16
+ - REGISTERED_FORK_CALLBACK = true;
17
+ - }
18
+ - }
19
+ + // #[cfg(target_family = "unix")]
20
+ + // unsafe {
21
+ + // if !REGISTERED_FORK_CALLBACK {
22
+ + // libc::pthread_atfork(None, None, Some(child_after_fork));
23
+ + // REGISTERED_FORK_CALLBACK = true;
24
+ + // }
25
+ + // }
26
+
27
+ m.add_class::<tokenizer::PyTokenizer>()?;
28
+ m.add_class::<tokenizer::PyAddedToken>()?;
You can’t perform that action at this time.
0 commit comments