Skip to content

Commit 9648f9d

Browse files
committed
Fixup python3.9 support
1 parent 7be79ed commit 9648f9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • maayanlab_bioinformatics/parse

maayanlab_bioinformatics/parse/gmt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class GMT:
141141
gene_lists: list[list[str]]
142142

143143
@staticmethod
144-
def reader(gmtfile: io.TextIOBase | str | pathlib.Path) -> typing.Iterator[tuple[tuple[str, str], list[str]]]:
144+
def reader(gmtfile: typing.Union[io.TextIOBase, str, pathlib.Path]) -> typing.Iterator[tuple[tuple[str, str], list[str]]]:
145145
''' read the .gmt format, a tab separated file with variable columns
146146
'''
147147
gene_expr = re.compile(r'^([^:;,]+?)([:;,].+)?$')
@@ -184,7 +184,7 @@ def concat(*gmts):
184184
return GMT(list(background), terms, gene_lists)
185185

186186
@staticmethod
187-
def from_file(gmtfile: io.TextIOBase | str | pathlib.Path):
187+
def from_file(gmtfile: typing.Union[io.TextIOBase, str, pathlib.Path]):
188188
''' initialze a GMT from a file
189189
'''
190190
return GMT.from_iter(GMT.reader(gmtfile))

0 commit comments

Comments
 (0)