[pypy-dev] cppyy_backend logging issue

Matti Picus matti.picus at gmail.com
Wed Oct 24 16:51:29 EDT 2018


On 24/10/18 10:46 pm, Ivan Stepanov wrote:
> cppyy doesn't work propertly.
>
> Traceback (most recent call last):
>   File 
> "/usr/lib/python3.7/site-packages/cppyy_backend/_cppyy_generator.py", 
> line 692, in main
>     mapping = g.create_mapping(args.sources)
>   File 
> "/usr/lib/python3.7/site-packages/cppyy_backend/_cppyy_generator.py", 
> line 214, in create_mapping
>     file_info = self.create_file_mapping(h_file)
>   File 
> "/usr/lib/python3.7/site-packages/cppyy_backend/_cppyy_generator.py", 
> line 244, in create_file_mapping
>     logger.log(m * diag.severity + c, "While parsing: {}".format(msg))
>   File "/usr/lib/python3.7/logging/__init__.py", line 1395, in log
>     raise TypeError("level must be an integer")
> TypeError: level must be an integer
>
> System info:
> Manjaro (Arch linux)
> Python 3.7.0
> CPyCppyy 1.3.6
> cppyy 1.2.4
> cppyy-backend 1.4.2
> cppyy-cling 6.14.2.1
>
> Possible solution:
> in file cppyy_backend/_cppyy_generator.py:
> - logger.log(m * diag.severity + c, "While parsing: {}".format(msg))
> +    logger.log(int(m * diag.severity + c), "While parsing: 
> {}".format(msg))
>

Does this fix it, in the same file cppyy_backend/_cppyy_generator.py:

- m= (logging.ERROR- logging.WARNING)/(Diagnostic.Error- Diagnostic.Warning)
+ m= (logging.ERROR- logging.WARNING) // (Diagnostic.Error- 
Diagnostic.Warning)
Matti


More information about the pypy-dev mailing list