I am getting error when running bench setup nginx after applying SSL on the site

I am getting this error when running bench setup nginx after applying SSL on the site
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/cs-frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/lib/python3/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/cs-frappe/.bench/bench/commands/setup.py”, line 22, in setup_nginx
make_nginx_conf(bench_path=".", yes=yes)
File “/home/cs-frappe/.bench/bench/config/nginx.py”, line 13, in make_nginx_conf
sites = prepare_sites(config, bench_path)
File “/home/cs-frappe/.bench/bench/config/nginx.py”, line 100, in prepare_sites
sites_configs = get_sites_with_config(bench_path=bench_path)
File “/home/cs-frappe/.bench/bench/config/nginx.py”, line 217, in get_sites_with_config
if isinstance(domain, str) or isinstance(domain, unicode):
NameError: name ‘unicode’ is not defined