diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index d7e301268b..802ea865cd 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -224,7 +224,11 @@ def __set_listen_on(self): interface = interface.strip() try: # add square brackets to ipv6 only, as needed by lib torrent - lib_interfaces.append('['+interface+']' if ipaddress.ip_address(interface).version == 6 else interface) + lib_interfaces.append( + '[' + interface + ']' + if ipaddress.ip_address(interface).version == 6 + else interface + ) except ValueError: # ip address format failed, assume network interface name lib_interfaces.append(interface)