diff --git a/languages/python/python_base_parser.go b/languages/python/python_base_parser.go index 7a826475fc77c7f5ffab7d85bc136af5558f506a..e00662a60d15eba1b2667fd22c9a7afc2a303cfc 100644 --- a/languages/python/python_base_parser.go +++ b/languages/python/python_base_parser.go @@ -14,7 +14,7 @@ var ( ) func (p *PythonBaseParser) CheckVersion(ver int) bool { - return ver == Autodetect || ver == Version + return Version == Autodetect || ver == Version } func (p *PythonBaseParser) SetVersion(ver int) { diff --git a/trial/pkg/application/pyapp/py_ident_app_test.go b/trial/pkg/application/pyapp/py_ident_app_test.go index 54e30ef96fa3958b16a7c9e6a325f77b701598c8..cab49c82938d86dc722d0fa0cc42474c1f1b8554 100644 --- a/trial/pkg/application/pyapp/py_ident_app_test.go +++ b/trial/pkg/application/pyapp/py_ident_app_test.go @@ -40,6 +40,17 @@ func Test_PythonClass(t *testing.T) { g.Expect(1).To(Equal(1)) } +func Test_PythonVersion(t *testing.T) { + g := NewGomegaWithT(t) + + app := new(PythonApiApp) + + app.Analysis("print 'a' ", "") + app.Analysis("print('a')", "") + + g.Expect(1).To(Equal(1)) +} + func Test_PythonFuncDefStm(t *testing.T) { g := NewGomegaWithT(t)