Repository: pydantic/pydantic

Issue:
`from pydantic import RootModel` fails in Python 3.10.0
### Initial Checks

- [X] I confirm that I'm using Pydantic V2

### Description

## The problem

`RootModel` import on Python 3.10.0 (and only 3.10.0) fails with:

```
...
  File "<snipped>/lib/python3.10/site-packages/pydantic/root_model.py", line 26, in <module>
    class RootModel(BaseModel, typing.Generic[RootModelRootType]):
  File "<snipped>/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 172, in __new__
    set_model_fields(cls, bases, config_wrapper, types_namespace)
  File "<snipped>/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 400, in set_model_fields
    fields, class_vars = collect_model_fields(cls, bases, config_wrapper, types_namespace, typevars_map=typevars_map)
  File "<snipped>/lib/python3.10/site-packages/pydantic/_internal/_fields.py", line 98, in collect_model_fields
    type_hints = get_cls_type_hints_lenient(cls, types_namespace)
  File "<snipped>/lib/python3.10/site-packages/pydantic/_internal/_typing_extra.py", line 212, in get_cls_type_hints_lenient
    hints[name] = eval_type_lenient(value, globalns, localns)
  File "<snipped>/lib/python3.10/site-packages/pydantic/_internal/_typing_extra.py", line 221, in eval_type_lenient
    value = _make_forward_ref(value, is_argument=False, is_class=True)
TypeError: ForwardRef.__init__() got an unexpected keyword argument 'is_class'
```

The problem does not exist on 3.10.1+.

Seems like the reason is already described [here](https://github.com/pydantic/pydantic/discussions/6244), but for Python 3.9.

## The fix

Since Pydantic depends on [bpo-45166](https://github.com/python/cpython/pull/28561) fix to `get_type_hints`, and [that fix was only included in 3.10.1](https://docs.python.org/3.10/whatsnew/changelog.html#python-3-10-1-final) (was *not* present in 3.10.0), the hard-coded python version for 3.9 branch here:

https://github.com/pydantic/pydantic/blob/b33a795ffd1ddc530cf3d0622ec7f53e8851f18c/pydantic/_internal/_typing_extra.py#L256

should be expanded to include the bpo-45166 fix in the 3.10 branch as well.

### Example Code

```Python
from pydantic import RootModel
```


### Python, Pydantic & OS Version

```Text
pydantic version: 2.1.1
        pydantic-core version: 2.4.0
          pydantic-core build: profile=release pgo=true mimalloc=true
                 install path: /<omitted>/lib/python3.10/site-packages/pydantic
               python version: 3.10.0 (default, Nov 24 2021, 12:59:45) [GCC 5.4.0 20160609]
                     platform: Linux-4.15.0-142-generic-x86_64-with-glibc2.23
     optional deps. installed: ['typing-extensions']
```


Selected Assignee: @Kludex


Discussion:

Resolving patch:
diff --git a/pydantic/_internal/_typing_extra.py b/pydantic/_internal/_typing_extra.py
--- a/pydantic/_internal/_typing_extra.py
+++ b/pydantic/_internal/_typing_extra.py
@@ -253,7 +253,7 @@ def get_function_type_hints(
     return type_hints
 
 
-if sys.version_info < (3, 9, 8):
+if sys.version_info < (3, 9, 8) or (3, 10) <= sys.version_info < (3, 10, 1):
 
     def _make_forward_ref(
         arg: Any,
@@ -262,11 +262,13 @@ def _make_forward_ref(
         is_class: bool = False,
     ) -> typing.ForwardRef:
         """Wrapper for ForwardRef that accounts for the `is_class` argument missing in older versions.
-        The `module` argument is omitted as it breaks <3.9.8 and isn't used in the calls below.
+        The `module` argument is omitted as it breaks <3.9.8, =3.10.0 and isn't used in the calls below.
 
         See https://github.com/python/cpython/pull/28560 for some background.
         The backport happened on 3.9.8, see:
-        https://github.com/pydantic/pydantic/discussions/6244#discussioncomment-6275458.
+        https://github.com/pydantic/pydantic/discussions/6244#discussioncomment-6275458,
+        and on 3.10.1 for the 3.10 branch, see:
+        https://github.com/pydantic/pydantic/issues/6912
 
         Implemented as EAFP with memory.
         """


Test patch: