I had same issue and solved by following solution.
I came across this same issue and managed to remove the error by going to Settings>Editor>Inspections. In the list of inspections there is one called "Code is compatible with specific Python versions". You can uncheck this to remove the feature OR you can click that option and choose the versions that you want to get warnings for in the box to the right of the main list.