Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45f7976

Browse files
Merge pull request#178 from dmitry-lipetsk/D20250131_001--find_free_port
PortManager::find_free_port is updated
2 parents4453e8f +bc893d8 commit45f7976

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎testgres/helpers/port_manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ def find_free_port(self, ports: Optional[Set[int]] = None, exclude_ports: Option
2626
ifportsisNone:
2727
ports=set(range(1024,65535))
2828

29-
ifexclude_portsisNone:
30-
exclude_ports=set()
29+
asserttype(ports)==set# noqa: E721
3130

32-
ports.difference_update(set(exclude_ports))
31+
ifexclude_portsisnotNone:
32+
assertisinstance(exclude_ports,Iterable)
33+
ports.difference_update(exclude_ports)
3334

3435
sampled_ports=random.sample(tuple(ports),min(len(ports),100))
3536

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp