ImportError: cannot import name 'Match'

Hi,

since month I am not able to update ERPNext due to error:
ImportError: cannot import name ‘Match’

My current versions are
ERPNext 13.45.0
Frappe 13.49.0

Running on Ubuntu 18.04.6 (Next topic on my list)

Updating DocTypes for frappe : [========================================] 100%
Updating DocTypes for erpnext : [========================================] 100%
Updating DocTypes for ecommerce_integrations: [========================================] 100%
Updating Dashboard for frappe
Updating Dashboard for erpnext
Updating Dashboard for ecommerce_integrations
Updating customizations for Address
Updating customizations for Contact

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/utils/bench_helper.py”, line 110, in
main()
File “/home/erpnext/frappe_bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/frappe_bench/env/lib/python3.6/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/commands/init.py”, line 31, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/commands/site.py”, line 433, in migrate
migrate(context.verbose, skip_failing=skip_failing, skip_search_index=skip_search_index)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/migrate.py”, line 87, in migrate
frappe.get_single(“Installed Applications”).update_versions()
File “/home/erpnext/frappe_bench/apps/frappe/frappe/core/doctype/installed_applications/installed_applications.py”, line 30, in update_versions
self.save()
File “/home/erpnext/frappe_bench/apps/frappe/frappe/model/document.py”, line 312, in save
return self._save(*args, **kwargs)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/model/document.py”, line 366, in _save
self.run_post_save_methods()
File “/home/erpnext/frappe_bench/apps/frappe/frappe/model/document.py”, line 1107, in run_post_save_methods
self.save_version()
File “/home/erpnext/frappe_bench/apps/frappe/frappe/model/document.py”, line 1224, in save_version
if version.update_version_info(self._doc_before_save, self):
File “/home/erpnext/frappe_bench/apps/frappe/frappe/core/doctype/version/version.py”, line 21, in update_version_info
return self.set_diff(old, new)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/core/doctype/version/version.py”, line 29, in set_diff
self.data = frappe.as_json(diff, indent=None, separators=(“,”, “:”))
File “/home/erpnext/frappe_bench/apps/frappe/frappe/init.py”, line 1784, in as_json
obj, indent=indent, sort_keys=True, default=json_handler, separators=separators
File “/usr/lib/python3.6/json/init.py”, line 238, in dumps
**kw).encode(obj)
File “/usr/lib/python3.6/json/encoder.py”, line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File “/usr/lib/python3.6/json/encoder.py”, line 257, in iterencode
return _iterencode(o, 0)
File “/home/erpnext/frappe_bench/apps/frappe/frappe/utils/response.py”, line 160, in json_handler
from re import Match
ImportError: cannot import name ‘Match’

Any help is appreciated.
thanks