File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 33import base64
44from typing import List , Optional
55
6+ # Core imports
67import httpx
78import logging
9+
10+ # Monkey-patch PyDyf PDF constructor to accept extra args for compatibility
11+ try :
12+ import pydyf
13+ _orig_pdf_init = pydyf .PDF .__init__
14+ def _patched_pdf_init (self , * args , ** kwargs ):
15+ return _orig_pdf_init (self )
16+ pydyf .PDF .__init__ = _patched_pdf_init
17+ logging .getLogger (__name__ ).info ("Patched pydyf.PDF.__init__ to accept extra args" )
18+ except ImportError :
19+ logging .getLogger (__name__ ).warning ("pydyf not installed; cannot patch PDF constructor" )
20+ except Exception as e :
21+ logging .getLogger (__name__ ).error (f"Error patching pydyf.PDF.__init__: { e } " )
22+
823from weasyprint import HTML
924
25+ # Monkey-patch PyDyf PDF constructor to accept extra args for compatibility
26+ try :
27+ import pydyf
28+ _orig_pdf_init = pydyf .PDF .__init__
29+ def _patched_pdf_init (self , * args , ** kwargs ):
30+ return _orig_pdf_init (self )
31+ pydyf .PDF .__init__ = _patched_pdf_init
32+ logging .getLogger (__name__ ).info ("Patched pydyf.PDF.__init__ to accept extra args" )
33+ except ImportError :
34+ logging .getLogger (__name__ ).warning ("pydyf not installed; cannot patch PDF constructor" )
35+ except Exception as e :
36+ logging .getLogger (__name__ ).error (f"Error patching pydyf.PDF.__init__: { e } " )
37+
1038# Node decorator with retry logic
1139class Node :
1240 def __init__ (self , retries : int = 0 ):
You can’t perform that action at this time.
0 commit comments