We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In my code, I would like to use the match statement. I compiled this method using Cython3.0.9 version, but got the following error.
Here is the python code
import argparse import logging import re import os import sys import uvicorn import time import threading from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from datetime import datetime, timezone from common.loggin_middleware import * from common.server_context import ServerContext from query_system.document_api import document from query_system.initialize import initialize from query_system.knowledge_api import knowledge from query_system.message_api import message from common.log_wrapper import * from common.config import Config, get_config from query_system.query_debug import server_debug, qa from query_system.sensitive_api import sensitive from common.log_wrapper import * conf = get_config() lib_path = conf.get_lib_config() product_name, lic_path, quota_name, interval = conf.get_lic_config() print(f"path is {lib_path} product_name is {product_name} lic_path is {lic_path} quota_name is {quota_name} interval is {interval}") master = "https://private.ca.abc.com:8443" slave = "https://slave.private.ca.abc.com:8443" time_out = 30 sys.path.append(lib_path) import _license logger = logging.getLogger(__name__) def read_license(file_path): with open(file_path, 'r') as file: c_lic = file.read() return c_lic def auth(code): pid = os.getpid() tid = threading.get_ident() match code: case 0: logger.info(f"[AUTH] success pid: {pid}, tid: {tid}") return case -1: logger.info(f"[AUTH] invalid param pid: {pid}, tid: {tid}") os._exit(1) case -2: logger.info(f"[AUTH] init method error pid: {pid}, tid: {tid}") os._exit(1) case -3: logger.info(f"[AUTH] authentication method error pid: {pid}, tid: {tid}") os._exit(1) case _: print("Unknown error") os._exit(1) ...... ......
The following is the error message
[1/1] Cythonizing /data/wisdom-vault/app/query_server.py Error compiling Cython file: ------------------------------------------------------------ ... def auth(code): pid = os.getpid() tid = threading.get_ident() match code: ^ ------------------------------------------------------------ app/query_server.py:51:10: Syntax error in simple statement list Traceback (most recent call last): File "/data/wisdom-vault/setup.py", line 43, in <module> setup(ext_modules=cythonize(f_name), ^^^^^^^^^^^^^^^^^ File "/data/miniconda3/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize cythonize_one(*args) File "/data/miniconda3/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: /data/wisdom-vault/app/query_server.py
Can Cython support match statement in Python?
NA
Python version 3.11.5 Cython version 3.0.9
The text was updated successfully, but these errors were encountered:
#4029
Sorry, something went wrong.
No branches or pull requests
Is your feature request related to a problem? Please describe.
In my code, I would like to use the match statement. I compiled this method using Cython3.0.9 version, but got the following error.
Here is the python code
The following is the error message
Describe the solution you'd like.
Can Cython support match statement in Python?
Describe alternatives you've considered.
NA
Additional context
Python version 3.11.5
Cython version 3.0.9
The text was updated successfully, but these errors were encountered: