Alexey-T / Python-for-Lazarus

Fork of Python4Delphi for Lazarus, supports Windows/Linux/macOS/*BSD/Solaris
MIT License
127 stars 42 forks source link

Invalid syntax when compiling the package #33

Closed ThaiDat closed 3 years ago

ThaiDat commented 3 years ago

Can not install the latest version due to a compile error. Seem because this line is invalid syntax

https://github.com/Alexey-T/Python-for-Lazarus/blob/1b044d8b932189ac159d996e02419602a087dc36/python4lazarus/PythonEngine.pas#L2616

I update full compiler error log:

Compile package python4lazarus_package 1.4: Exit code 1, Errors: 2, Hints: 12
...(Hints)...
PythonEngine.pas(2617,17) Error: Procedure or Function expected
PythonEngine.pas(2617,17) Fatal: Syntax error, "identifier" expected but "THREADVAR" found

PS: FPC version 3.04, Lazarus version 2.0.4

ThaiDat commented 3 years ago

I found that it is a compatibility issue as class threadvar is the new feature introduced in FPC 3.2. I think it would be a lot better to make the new version of the library backward compatible with older versions of the compiler. Anyway, it's my fault that doesn't check for requirements carefully.

Alexey-T commented 3 years ago

I don’t know how to replace it - with ifdef of course.