We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7221a0 commit 1bf665fCopy full SHA for 1bf665f
1 file changed
src/hermes_toml/harvest.py
@@ -4,6 +4,7 @@
4
import pathlib
5
import toml
6
7
+from contextlib import chdir
8
from email.utils import getaddresses
9
from pydantic import BaseModel
10
@@ -39,14 +40,14 @@ def __call__(self, command: HermesHarvestCommand):
39
40
path = command.args.path
41
old_path = pathlib.Path.cwd()
42
if path != old_path:
- os.chdir(path)
43
+ chdir(path)
44
45
#harvesting the data from the .toml file specified in the Settings class
46
data = self.read_from_toml(command.settings.toml.filename)
47
48
#resetting the working directory
49
- os.chdir(old_path)
50
+ chdir(old_path)
51
52
#returning the harvested data and some metadata
53
return data, {"filename": command.settings.toml.filename}
0 commit comments