Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
MihanixA committed Mar 26, 2021
1 parent 8c1875a commit c988e04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydantic/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def build(
if user or password:
url += '@'
url += host
if port and ('port' not in cls.hidden_parts):
if port and cls.hidden_parts and 'port' not in cls.hidden_parts:
url += ':' + port
if path:
url += path
Expand Down Expand Up @@ -336,7 +336,7 @@ def get_default_parts(parts: 'Parts') -> 'Parts':
@classmethod
def hide_parts(cls, original_parts: 'Parts') -> None:
super().hide_parts(original_parts)
if 'port' in original_parts:
if cls.hidden_parts and 'port' in original_parts:
cls.hidden_parts.add('port')


Expand Down

0 comments on commit c988e04

Please sign in to comment.