Skip to content

Commit

Permalink
fix: Import default certification to bypass macos request error (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: liangtie.qian <yihuo0420@gmail.com>
  • Loading branch information
2 people authored and SYSUeric66 committed Nov 2, 2023
1 parent 2fbb651 commit 6370008
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion kicad_amf_plugin/plugin/_main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
DEFAULT_CERTIFICATION = None
if DEFAULT_CERTIFICATION is None:
import certifi
import ssl
ssl._create_default_https_context = lambda: ssl.create_default_context(cafile=certifi.where())
DEFAULT_CERTIFICATION = True
from kicad_amf_plugin.settings.single_plugin import SINGLE_PLUGIN


def _main():
if not SINGLE_PLUGIN.show_existing():
from kicad_amf_plugin.gui.app_base import BaseApp
Expand Down
2 changes: 0 additions & 2 deletions test/test_query_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from kicad_amf_plugin.order.supported_region import SupportedRegion
from kicad_amf_plugin.order.order_region import OrderRegion, URL_KIND

import requests

import urllib
import os
import json
Expand Down
4 changes: 3 additions & 1 deletion test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# -*- coding: utf-8 -*-
import json


import certifi
import ssl
ssl._create_default_https_context = lambda: ssl.create_default_context(cafile=certifi.where())
class TestUtils:
@staticmethod
def read_json(fp: str):
Expand Down

0 comments on commit 6370008

Please sign in to comment.