Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 9c05353

Browse files
committed
Fixed script file to import correctly
1 parent 8b331a8 commit 9c05353

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

pep257

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#! /usr/bin/env python
2-
import sys
3-
from pep257 import main, parse_options
2+
from pep257 import main
43

54

65
if __name__ == '__main__':
7-
try:
8-
sys.exit(main(*parse_options()))
9-
except KeyboardInterrupt:
10-
pass
6+
main()

pep257.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def setup_stream_handler(options):
545545
log.addHandler(stream_handler)
546546

547547

548-
def main():
548+
def run_pep257():
549549
opt_parser = get_option_parser()
550550
# setup the logger before parsing the config file, so that command line
551551
# arguments for debug / verbose will be printed.
@@ -883,8 +883,12 @@ def SKIP_check_return_type(self, function, docstring):
883883
return Error()
884884

885885

886-
if __name__ == '__main__':
886+
def main():
887887
try:
888-
sys.exit(main())
888+
sys.exit(run_pep257())
889889
except KeyboardInterrupt:
890890
pass
891+
892+
893+
if __name__ == '__main__':
894+
main()

test_pep257.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def open(self, path, *args, **kwargs):
4848

4949
def invoke_pep257(self, args=""):
5050
"""Run pep257.py on the environment base folder with the given args."""
51-
pep257_location = os.path.join(os.path.dirname(__file__), 'pep257.py')
52-
cmd = shlex.split("python {0} {1} {2}"
51+
pep257_location = os.path.join(os.path.dirname(__file__), 'pep257')
52+
cmd = shlex.split("{0} {1} {2}"
5353
.format(pep257_location, self.tempdir, args))
5454
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
5555
stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)