Skip to content

Commit e29109d

Browse files
committed
pip compatbility fixes
1 parent c1d49d1 commit e29109d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

mbed/mbed.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
verbose = False
120120
very_verbose = False
121121

122+
# stores current working directory for recursive operations
123+
cwd_root = ""
124+
122125

123126
# Logging and output
124127
def message(msg):
@@ -2235,11 +2238,13 @@ def toolchain_(name=None, global_cfg=False, supported=False):
22352238
def help_():
22362239
return parser.print_help()
22372240

2238-
# Help messages adapt based on current dir
2239-
cwd_root = os.getcwd()
22402241

2242+
def main():
2243+
global verbose, very_verbose, remainder, cwd_root
2244+
2245+
# Help messages adapt based on current dir
2246+
cwd_root = os.getcwd()
22412247

2242-
if __name__ == "__main__":
22432248
# Parse/run command
22442249
if len(sys.argv) <= 1:
22452250
help_()
@@ -2276,3 +2281,7 @@ def help_():
22762281
traceback.print_exc(file=sys.stdout)
22772282
error("Unknown Error: %s" % e, 255)
22782283
sys.exit(status or 0)
2284+
2285+
2286+
if __name__ == "__main__":
2287+
main()

0 commit comments

Comments
 (0)