Skip to content

Commit f4afd2a

Browse files
committed
Yaml full loader is only for python 3.7. Add check for that.
1 parent 8a50dae commit f4afd2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rl/book/chapter_2/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def main():
179179
logger: Logger = Logger(parser=parser)
180180
options = parser.parse_args()
181181
with open(sys.argv[1], 'r') as f:
182-
configuration = yaml.load(f, Loader=yaml.FullLoader)
182+
if hasattr(yaml, "FullLoader"):
183+
configuration = yaml.load(f, Loader=yaml.FullLoader)
183184

184185
if options.num_episodes:
185186
configuration["num_episodes"] = options.num_episodes

0 commit comments

Comments
 (0)