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

Commit27c40d2

Browse files
PortManager::find_free_port is updated
Asserts are added: - ports must be the "set" - exclude_ports must be iterableDo not convert exclude_ports into "set" [optimization?]
1 parentab7de69 commit27c40d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎testgres/helpers/port_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +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+
asserttype(ports)==set
30+
2931
ifexclude_portsisnotNone:
30-
ports.difference_update(set(exclude_ports))
32+
assertisinstance(exclude_ports,Iterable)
33+
ports.difference_update(exclude_ports)
3134

3235
sampled_ports=random.sample(tuple(ports),min(len(ports),100))
3336

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp