diff --git a/src/RestrictedPython/compile.py b/src/RestrictedPython/compile.py
index 391d4b5..aee78f6 100644
--- a/src/RestrictedPython/compile.py
+++ b/src/RestrictedPython/compile.py
@@ -60,7 +60,7 @@ def _compile_restricted_mode(
                     lineno=v.lineno,
                     type=v.__class__.__name__,
                     msg=v.msg,
-                    statement=v.text.strip()
+                    statement=v.text.strip() if v.text else None
                 ))
         if c_ast:
             policy_instance = policy(

Can't handle SyntaxError: can't assign to literal
```
from RestrictedPython import compile_restricted

code = """
1 = 2
 """

compile_restricted(code, '<string>', 'exec')
---------------------------------------------------------------------------
SyntaxError                               Traceback (most recent call last)
~/.virtualenvs/flask-py3/lib/python3.6/site-packages/RestrictedPython/compile.py in _compile_restricted_mode(source, filename, mode, flags, dont_inherit, policy)
     54             try:
---> 55                 c_ast = ast.parse(source, filename, mode)
     56             except (TypeError, ValueError) as e:

/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py in parse(source, filename, mode)
     34     """
---> 35     return compile(source, filename, mode, PyCF_ONLY_AST)
     36

SyntaxError: can't assign to literal (<string>, line 2)

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-10-e894370f632e> in <module>()
----> 1 compile_restricted(code, '<string>', 'exec')

~/.virtualenvs/flask-py3/lib/python3.6/site-packages/RestrictedPython/compile.py in compile_restricted(source, filename, mode, flags, dont_inherit, policy)
    194             flags=flags,
    195             dont_inherit=dont_inherit,
--> 196             policy=policy)
    197     else:
    198         raise TypeError('unknown mode %s', mode)

~/.virtualenvs/flask-py3/lib/python3.6/site-packages/RestrictedPython/compile.py in _compile_restricted_mode(source, filename, mode, flags, dont_inherit, policy)
     61                     type=v.__class__.__name__,
     62                     msg=v.msg,
---> 63                     statement=v.text.strip()
     64                 ))
     65         if c_ast:

AttributeError: 'NoneType' object has no attribute 'strip'
```

when assign to literal, the error text is None

Environment:
os: maxOS
python version: 3.6
RestrictedPython version: 4.0b4
diff --git a/tests/test_compile.py b/tests/test_compile.py
index 8d48ec0..5a05703 100644
--- a/tests/test_compile.py
+++ b/tests/test_compile.py
@@ -31,6 +31,17 @@ def test_compile__compile_restricted_invalid_mode_input():
         compile_restricted("pass", '<string>', 'invalid')
 
 
+INVALID_ASSINGMENT = """
+1 = 2
+"""
+
+
+def test_compile__invalid_syntax():
+    with pytest.raises(SyntaxError) as err:
+        compile_restricted(INVALID_ASSINGMENT, '<string>', 'exec')
+    assert "can't assign to literal at statement:" in str(err.value)
+
+
 @pytest.mark.parametrize(*c_exec)
 def test_compile__compile_restricted_exec__1(c_exec):
     """It returns a CompileResult on success."""

pip install -e .[test]
parse_log_pytest
pytest
pytest pytest-mock
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-mock==3.6.1
-e git+https://github.com/zopefoundation/RestrictedPython.git@42b4be0237f0990f5a2121d0ca7035be53b87305#egg=RestrictedPython
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: RestrictedPython
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - pytest-mock==3.6.1
prefix: /opt/conda/envs/RestrictedPython

tests/test_compile.py::test_compile__invalid_syntax
tests/test_compile.py::test_compile_restricted_eval
tests/test_compile.py::test_compile__compile_restricted_invalid_code_input tests/test_compile.py::test_compile__compile_restricted_invalid_policy_input tests/test_compile.py::test_compile__compile_restricted_invalid_mode_input tests/test_compile.py::test_compile__compile_restricted_exec__1[compile_restricted_exec] tests/test_compile.py::test_compile__compile_restricted_exec__2[compile_restricted_exec] tests/test_compile.py::test_compile__compile_restricted_exec__3[compile_restricted_exec] tests/test_compile.py::test_compile__compile_restricted_exec__4[compile_restricted_exec] tests/test_compile.py::test_compile__compile_restricted_exec__5[compile_restricted_exec] tests/test_compile.py::test_compile__compile_restricted_exec__10[compile_restricted_exec] tests/test_compile.py::test_compile__compile_restricted_eval__1[compile_restricted_eval] tests/test_compile.py::test_compile__compile_restricted_eval__2[_eval] tests/test_compile.py::test_compile__compile_restricted_eval__used_names[compile_restricted_eval] tests/test_compile.py::test_compile__compile_restricted_csingle[compile_restricted_single] tests/test_compile.py::test_compile___compile_restricted_mode__1
src/RestrictedPython/compile.py
src/RestrictedPython/compile.py