Skip to content

Commit

Permalink
Don't run get_paper_size before warnings set up
Browse files Browse the repository at this point in the history
  • Loading branch information
rrthomas committed Aug 19, 2024
1 parent ec241b9 commit 9d7c2f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion psutils/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def dimension(s: str) -> float:


class PaperContext: # pylint: disable=too-few-public-methods
def __init__(self, size: Optional[Rectangle] = get_paper_size()) -> None:
def __init__(self, size: Optional[Rectangle] = None) -> None:
if size is None:
# Run get_paper_size at run-time, so we have already set up the
# warning handler.
size = get_paper_size()
self.default_paper = size

def dimension(
Expand Down

0 comments on commit 9d7c2f3

Please sign in to comment.