Skip to content

Commit

Permalink
Replace typing_extensions.Literal by the type of the literal
Browse files Browse the repository at this point in the history
  • Loading branch information
pietermarsman committed Oct 11, 2021
1 parent f9e8857 commit fb9b83e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pdfminer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import (Any, BinaryIO, Callable, Dict, Generic, Iterable, Iterator,
List, Optional, Set, TextIO, Tuple, TypeVar, Union,
TYPE_CHECKING, cast)
from typing_extensions import Literal
from html import escape

if TYPE_CHECKING:
Expand Down Expand Up @@ -55,7 +54,7 @@ def __exit__(
exc_type: object,
exc_val: object,
exc_tb: object
) -> Literal[False]:
) -> bool: # Literal[False]
if self.closing:
self.file_handler.close()
return False
Expand Down
3 changes: 1 addition & 2 deletions tools/pdf2txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging
import sys
from typing import Any, Container, Iterable, List, Optional, Union
from typing_extensions import Literal

import pdfminer.high_level
from pdfminer.layout import LAParams
Expand All @@ -18,7 +17,7 @@
(".xml", "xml"),
(".tag", "tag"))

FloatOrDisabled = Union[float, Literal["disabled"]]
FloatOrDisabled = Union[float, str] # Union[float, Literal["disabled"]]


def float_or_disabled(x: str) -> FloatOrDisabled:
Expand Down

0 comments on commit fb9b83e

Please sign in to comment.