Skip to content

Commit

Permalink
Restrict to trio unless preview is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
augustelalande committed Jul 8, 2024
1 parent 4ef2faf commit aece7aa
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,17 @@ pub(crate) fn async_function_with_timeout(
AsyncModule::AsyncIO
};

checker.diagnostics.push(Diagnostic::new(
AsyncFunctionWithTimeout { module },
timeout.range(),
));
if matches!(checker.settings.preview, PreviewMode::Disabled) {
if matches!(module, AsyncModule::Trio) {
checker.diagnostics.push(Diagnostic::new(
AsyncFunctionWithTimeout { module },
timeout.range(),
));
}
} else {
checker.diagnostics.push(Diagnostic::new(
AsyncFunctionWithTimeout { module },
timeout.range(),
));
}
}

0 comments on commit aece7aa

Please sign in to comment.