14
14
)
15
15
from typing import (
16
16
Any ,
17
- Optional ,
18
17
Type ,
19
18
Union ,
20
19
)
@@ -86,20 +85,15 @@ def reset(self) -> socket.socket:
86
85
return self .sock
87
86
88
87
89
- def get_default_ipc_path () -> Optional [ str ] :
88
+ def get_default_ipc_path () -> str :
90
89
if sys .platform == "darwin" :
91
- ipc_path = os .path .expanduser (
92
- os .path .join ("~" , "Library" , "Ethereum" , "geth.ipc" )
93
- )
94
- return ipc_path
90
+ return os .path .expanduser (os .path .join ("~" , "Library" , "Ethereum" , "geth.ipc" ))
95
91
96
92
elif sys .platform .startswith ("linux" ) or sys .platform .startswith ("freebsd" ):
97
- ipc_path = os .path .expanduser (os .path .join ("~" , ".ethereum" , "geth.ipc" ))
98
- return ipc_path
93
+ return os .path .expanduser (os .path .join ("~" , ".ethereum" , "geth.ipc" ))
99
94
100
95
elif sys .platform == "win32" :
101
- ipc_path = r"\\.\pipe\geth.ipc"
102
- return ipc_path
96
+ return r"\\.\pipe\geth.ipc"
103
97
104
98
else :
105
99
raise ValueError (
@@ -108,23 +102,19 @@ def get_default_ipc_path() -> Optional[str]:
108
102
)
109
103
110
104
111
- def get_dev_ipc_path () -> Optional [ str ] :
105
+ def get_dev_ipc_path () -> str :
112
106
if os .environ .get ("WEB3_PROVIDER_URI" , "" ):
113
- ipc_path = os .environ .get ("WEB3_PROVIDER_URI" )
114
- return ipc_path
107
+ return os .environ .get ("WEB3_PROVIDER_URI" )
115
108
116
109
elif sys .platform == "darwin" :
117
110
tmpdir = os .environ .get ("TMPDIR" , "" )
118
- ipc_path = os .path .expanduser (os .path .join (tmpdir , "geth.ipc" ))
119
- return ipc_path
111
+ return os .path .expanduser (os .path .join (tmpdir , "geth.ipc" ))
120
112
121
113
elif sys .platform .startswith ("linux" ) or sys .platform .startswith ("freebsd" ):
122
- ipc_path = os .path .expanduser (os .path .join ("/tmp" , "geth.ipc" ))
123
- return ipc_path
114
+ return os .path .expanduser (os .path .join ("/tmp" , "geth.ipc" ))
124
115
125
116
elif sys .platform == "win32" :
126
- ipc_path = os .path .join ("\\ \\ " , "." , "pipe" , "geth.ipc" )
127
- return ipc_path
117
+ return os .path .join ("\\ \\ " , "." , "pipe" , "geth.ipc" )
128
118
129
119
else :
130
120
raise ValueError (
0 commit comments