Skip to content

Commit

Permalink
fix sys.path.insert()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dino authored and Dino committed Dec 24, 2019
1 parent 7833f74 commit d3b7b2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
pkg_location = 'src'

import sys
sys.path.insert(0,pkg_location)
# Never sys.path.insert(0, ). Rather sys.path.insert(1, ) because
# third-party code may rely on sys.path documentation conformance:
# As initialized upon program startup, the first item of this list, path[0], is
# the directory containing the script that was used to invoke the Python interpreter.
sys.path.insert(1,pkg_location)
# for safety, make sure this: is the only import after changing sys.path
from mplfinance import __version__

Expand Down

0 comments on commit d3b7b2c

Please sign in to comment.