Skip to content

Commit 9f98949

Browse files
committed
[lldb] Move the python module import workaround further up
1 parent 02ad623 commit 9f98949

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lldb/examples/python/formatter_bytecode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ def next_byte():
463463

464464

465465
if __name__ == "__main__":
466+
# Work around the fact that one of the local files is called
467+
# types.py, which breaks some versions of python.
468+
import os, sys
469+
470+
path = os.path.abspath(os.path.dirname(__file__))
471+
sys.path.remove(path)
466472
import argparse
467473

468474
parser = argparse.ArgumentParser(
@@ -487,12 +493,6 @@ def next_byte():
487493
# Tests.
488494
############################################################################
489495
if args.test:
490-
# Work around the fact that one of the local files is calles
491-
# types.py, which breaks some versions of python.
492-
import os, sys
493-
494-
path = os.path.abspath(os.path.dirname(__file__))
495-
sys.path.remove(path)
496496
import unittest
497497

498498
class TestCompiler(unittest.TestCase):

0 commit comments

Comments
 (0)