File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1616from __future__ import annotations
1717
1818import inspect
19+ import sys
1920from importlib .metadata import entry_points
2021
2122from garf_io import exceptions
@@ -36,7 +37,7 @@ def create_writer(
3637
3738 Args:
3839 writer_option: Type of writer.
39- kwargs: Any possible arguments needed o instantiate writer.
40+ kwargs: Any possible arguments needed to instantiate writer.
4041
4142 Returns:
4243 Concrete instantiated writer.
@@ -45,7 +46,13 @@ def create_writer(
4546 ImportError: When writer specific library is not installed.
4647 GarfIoError: When incorrect writer option is specified.
4748 """
48- writers = entry_points (group = 'garf_writer' )
49+ if sys .version_info .major == 3 and sys .version_info .minor == 9 :
50+ try :
51+ writers = entry_points (group = 'garf_writer' )['garf_writer' ]
52+ except KeyError :
53+ writers = []
54+ else :
55+ writers = entry_points (group = 'garf_writer' )
4956 found_writers = {}
5057 for writer in writers :
5158 try :
You can’t perform that action at this time.
0 commit comments