Skip to content

Commit

Permalink
Drop contexter requirement using contextlib.ExitStack instead
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Feb 10, 2020
1 parent 7a1b4ed commit a573697
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Moved code of `Term.subclasses` and `Term.superclasses` to a dedicated
iterator class in the `pronto.logic` submodule.
- Dropped `contexter` requirement.
### Fixed
- Fix a typo in `Synonym.type` setter leading to a potential bug when
the given `type` is `None`.
Expand Down
8 changes: 4 additions & 4 deletions pronto/ontology.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import contextlib
import datetime
import itertools
import io
Expand All @@ -6,7 +7,6 @@
import urllib.parse
from typing import BinaryIO, Dict, Iterator, Mapping, Optional, Set, Union

import contexter
import fastobo

from . import relationship
Expand Down Expand Up @@ -134,7 +134,7 @@ def __init__(
"""
from .parsers import BaseParser

with contexter.Contexter() as ctx:
with contextlib.ExitStack() as ctx:
self.import_depth = import_depth
self.timeout = timeout
self.imports = dict()
Expand All @@ -152,8 +152,8 @@ def __init__(
# Get the path and the handle from arguments
if isinstance(handle, str):
self.path = handle
self.handle = ctx << get_handle(handle, timeout)
_handle = ctx << decompress(self.handle)
self.handle = ctx.enter_context(get_handle(handle, timeout))
_handle = ctx.enter_context(decompress(self.handle))
elif hasattr(handle, "read"):
self.path = get_location(handle)
self.handle = handle
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ test_suite = tests
setup_requires =
setuptools
install_requires =
contexter ~=0.1.4
chardet ~=3.0
fastobo ~=0.7.0
frozendict ~=1.2
Expand Down

0 comments on commit a573697

Please sign in to comment.