mirror of
https://github.com/wting/autojump
synced 2026-03-02 03:49:26 +00:00
Vendorize argparse
This adds the argparse library [1] as autojump_argparse and imports it via sys.path mangling in case argparse does not exist (Python 2.6 or below without argparse installed). This makes autojump effectively work with Python 2.6 again by default. I have not verified license compatibility, but given the intention of the (backport) project this is likely OK (it is licensed under the Python license). 1: http://code.google.com/p/argparse/ Fixes issue #121.
This commit is contained in:
11
bin/autojump
11
bin/autojump
@@ -21,12 +21,17 @@
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
import argparse
|
||||
from operator import itemgetter
|
||||
import sys
|
||||
import os
|
||||
try:
|
||||
import argparse
|
||||
except ImportError:
|
||||
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
||||
import autojump_argparse as argparse
|
||||
sys.path.pop()
|
||||
from operator import itemgetter
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
VERSION = 'release-v21-rc.2'
|
||||
|
||||
Reference in New Issue
Block a user