File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 30
30
import unittest
31
31
import warnings
32
32
from inspect import iscoroutinefunction
33
+ from pathlib import Path
33
34
34
35
from pymongo ._asyncio_task import create_task
35
36
69
70
db_user = os .environ .get ("DB_USER" , "user" )
70
71
db_pwd = os .environ .get ("DB_PASSWORD" , "password" )
71
72
72
- CERT_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "certificates" )
73
+ HERE = Path (__file__ ).absolute ()
74
+ if _IS_SYNC :
75
+ CERT_PATH = str (HERE .parent / "certificates" )
76
+ else :
77
+ CERT_PATH = str (HERE .parent .parent / "certificates" )
73
78
CLIENT_PEM = os .environ .get ("CLIENT_PEM" , os .path .join (CERT_PATH , "client.pem" ))
74
79
CA_PEM = os .environ .get ("CA_PEM" , os .path .join (CERT_PATH , "ca.pem" ))
75
80
Original file line number Diff line number Diff line change 30
30
import unittest
31
31
import warnings
32
32
from inspect import iscoroutinefunction
33
+ from pathlib import Path
33
34
34
35
from pymongo ._asyncio_task import create_task
35
36
69
70
db_user = os .environ .get ("DB_USER" , "user" )
70
71
db_pwd = os .environ .get ("DB_PASSWORD" , "password" )
71
72
72
- CERT_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "certificates" )
73
+ HERE = Path (__file__ ).absolute ()
74
+ if _IS_SYNC :
75
+ CERT_PATH = str (HERE .parent / "certificates" )
76
+ else :
77
+ CERT_PATH = str (HERE .parent .parent / "certificates" )
73
78
CLIENT_PEM = os .environ .get ("CLIENT_PEM" , os .path .join (CERT_PATH , "client.pem" ))
74
79
CA_PEM = os .environ .get ("CA_PEM" , os .path .join (CERT_PATH , "ca.pem" ))
75
80
You can’t perform that action at this time.
0 commit comments