utils

Exceptions:

TimeoutException

Functions:

time_limit(seconds)

timeout(func)

Defines a decorator for a 50ms timeout.

get_version()

Returns PVP version, and if available githash, as a string.

exception pvp.common.utils.TimeoutException[source]

Bases: Exception

pvp.common.utils.time_limit(seconds)[source]
pvp.common.utils.timeout(func)[source]

Defines a decorator for a 50ms timeout. Usage/Test:

@timeout def foo(sleeptime):

time.sleep(sleeptime)

print(“hello”)

pvp.common.utils.get_version()[source]

Returns PVP version, and if available githash, as a string.