mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.17k stars 177 forks source link

subprocess.Popen now uses a with-statement in powermetrics.py #637

Closed MyGodItsFull0fStars closed 2 months ago

MyGodItsFull0fStars commented 3 months ago

Replaced the regular call from process = subprocess.Popen(...) to with subprocess.Popen(...) as process as this variant is the recommended approach for resource allocating processes.

By using 'with' the release of the allocated resources is ensured even in the case of an exception. Source: Pylint R1732.

vercel[bot] commented 3 months ago

@MyGodItsFull0fStars is attempting to deploy a commit to the Code Carbon Team on Vercel.

A member of the Team first needs to authorize it.

MyGodItsFull0fStars commented 2 months ago

Thank you for merging my PR 🥳