Skip to content

Commit dd327b9

Browse files
authored
Use context manager to avoid ResourceWarning
This implicitly will call close to avoid an unclosed file warning.
1 parent 2a42539 commit dd327b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyverilog/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33

44
import os
55

6-
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().splitlines()[0]
6+
with open(os.path.join(os.path.dirname(__file__), "VERSION")) as f:
7+
__version__ = f.read().splitlines()[0]

0 commit comments

Comments
 (0)