Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aace290

Browse files
committedDec 11, 2017
Merge remote-tracking branch 'upstream/master' into tmp-unicode-path
* upstream/master: Add Yarikoptic to allowed release keys Remove redundant Python 2.4 code Specify Python 3.6 support to keep travis busy - adding myself to AUTHORS BF(WIN): where could report multiple hits, so choose first RF: use HIDE_WINDOWS_KNOWN_ERRORS instead of is_win to skip hooks tests BF(WIN): use where instead of which while looking for git RF(TST): skip all tests dealing with hooks on windows Disable (but keep for future uses commented out) hook into appveyor session RF: no "need" for custom shebang on windows since just does not work ENH: also report where on sh, and echo msg when entering on_finish ENH: add appveyor recipe to establish rdesktop login into the test box RF(+BF?): refactor hooks creation in a test, and may be make it compat with windows RF: last of flake8 fails - avoid using temp variable in a test BF: crazy tests ppl pass an object for status... uff -- catch TypeError too BF(PY26): {} -> {0}, i.e. explicit index for .format() RF: primarily flake8 lints + minor RF to reduce duplication in PATHEXT BF: wrap map into list, since iterator is not well digested by GitConfigParser BF: process included files before the rest version up
2 parents 7d30e08 + f14a596 commit aace290

23 files changed

+1888
-214
lines changed
 

‎.appveyor.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ install:
4646
echo %PATH%
4747
uname -a
4848
git --version
49-
where git git-daemon python pip pip3 pip34
49+
where git git-daemon python pip pip3 pip34 sh
5050
python --version
5151
python -c "import struct; print(struct.calcsize('P') * 8)"
5252
@@ -91,3 +91,11 @@ test_script:
9191

9292
on_success:
9393
- IF "%PYTHON_VERSION%" == "3.5" IF NOT "%IS_CYGWIN%" == "yes" (codecov)
94+
95+
# Enable this to be able to login to the build worker. You can use the
96+
# `remmina` program in Ubuntu, use the login information that the line below
97+
# prints into the log.
98+
#on_finish:
99+
# - |
100+
# echo "Running on_finish to establish connection back to the instance"
101+
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

‎AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ Contributors are:
2525
-Piotr Babij <piotr.babij _at_ gmail.com>
2626
-Mikuláš Poul <mikulaspoul _at_ gmail.com>
2727
-Charles Bouchard-Légaré <cblegare.atl _at_ ntis.ca>
28+
-Yaroslav Halchenko <debian _at_ onerussian.com>
2829

2930
Portions derived from other open source works and are clearly marked.

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If it is not in your `PATH`, you can help GitPython find it by setting
1919
the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
2020

2121
* Git (1.7.x or newer)
22-
* Python 2.7 to 3.5, while python 2.6 is supported on a *best-effort basis*.
22+
* Python 2.7 to 3.6, while python 2.6 is supported on a *best-effort basis*.
2323

2424
The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`.
2525
The installer takes care of installing them for you.
@@ -125,7 +125,7 @@ Please have a look at the [contributions file][contributing].
125125

126126
### How to verify a release
127127

128-
Please only use releases from `pypi` as you can verify the respective source
128+
Please only use releases from `pypi` as you can verify the respective source
129129
tarballs.
130130

131131
This script shows how to verify the tarball was indeed created by the authors of

‎VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.6
1+
2.1.7

‎git/compat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,5 +309,5 @@ def register_surrogateescape():
309309

310310
try:
311311
b"100644 \x9f\0aaa".decode(defenc, "surrogateescape")
312-
except:
312+
except Exception:
313313
register_surrogateescape()

‎git/config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ def read(self):
424424
if include_path in seen or not os.access(include_path, os.R_OK):
425425
continue
426426
seen.add(include_path)
427-
files_to_read.append(include_path)
427+
# insert included file to the top to be considered first
428+
files_to_read.insert(0, include_path)
428429
num_read_include_files += 1
429430
# each include path in configuration file
430431
# end handle includes

‎git/diff.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -313,20 +313,20 @@ def __str__(self):
313313
h %= self.b_blob.path
314314

315315
msg = ''
316-
l = None # temp line
317-
ll = 0 # line length
316+
line = None # temp line
317+
line_length = 0 # line length
318318
for b, n in zip((self.a_blob, self.b_blob), ('lhs', 'rhs')):
319319
if b:
320-
l = "\n%s: %o | %s" % (n, b.mode, b.hexsha)
320+
line = "\n%s: %o | %s" % (n, b.mode, b.hexsha)
321321
else:
322-
l = "\n%s: None" % n
322+
line = "\n%s: None" % n
323323
# END if blob is not None
324-
ll = max(len(l), ll)
325-
msg += l
324+
line_length = max(len(line), line_length)
325+
msg += line
326326
# END for each blob
327327

328328
# add headline
329-
h += '\n' + '=' * ll
329+
h += '\n' + '=' * line_length
330330

331331
if self.deleted_file:
332332
msg += '\nfile deleted in rhs'

‎git/exc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, command, status=None, stderr=None, stdout=None):
4848
else:
4949
try:
5050
status = u'exit code(%s)' % int(status)
51-
except:
51+
except (ValueError, TypeError):
5252
s = safe_decode(str(status))
5353
status = u"'%s'" % s if isinstance(status, string_types) else s
5454

‎git/refs/log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def to_file(self, filepath):
246246
try:
247247
self._serialize(fp)
248248
lfd.commit()
249-
except:
249+
except Exception:
250250
# on failure it rolls back automatically, but we make it clear
251251
lfd.rollback()
252252
raise

‎git/remote.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,11 @@ def urls(self):
542542
if ' Push URL:' in line:
543543
yield line.split(': ')[-1]
544544
except GitCommandError as ex:
545-
if any([msg in str(ex) for msg in ['correct access rights','cannot run ssh']]):
546-
# If ssh is not setup to access this repository, see issue 694
547-
result = Git().execute(['git','config','--get','remote.%s.url' % self.name])
545+
if any([msg in str(ex) for msg in ['correct access rights', 'cannot run ssh']]):
546+
# If ssh is not setup to access this repository, see issue 694
547+
result = Git().execute(
548+
['git', 'config', '--get', 'remote.%s.url' % self.name]
549+
)
548550
yield result
549551
else:
550552
raise ex

‎git/repo/base.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import logging
99
import os
1010
import re
11-
import sys
1211
import warnings
1312

1413
from git.cmd import (
@@ -40,11 +39,6 @@
4039

4140
log = logging.getLogger(__name__)
4241

43-
DefaultDBType = GitCmdObjectDB
44-
if sys.version_info[:2] < (2, 5): # python 2.4 compatibility
45-
DefaultDBType = GitCmdObjectDB
46-
# END handle python 2.4
47-
4842
BlameEntry = namedtuple('BlameEntry', ['commit', 'linenos', 'orig_path', 'orig_linenos'])
4943

5044

@@ -88,7 +82,7 @@ class Repo(object):
8882
# Subclasses may easily bring in their own custom types by placing a constructor or type here
8983
GitCommandWrapperType = Git
9084

91-
def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=False, expand_vars=True):
85+
def __init__(self, path=None, odbt=GitCmdObjectDB, search_parent_directories=False, expand_vars=True):
9286
"""Create a new Repo instance
9387
9488
:param path:
@@ -203,7 +197,7 @@ def __exit__(self, exc_type, exc_value, traceback):
203197
def __del__(self):
204198
try:
205199
self.close()
206-
except:
200+
except Exception:
207201
pass
208202

209203
def close(self):
@@ -869,7 +863,7 @@ def blame(self, rev, file, incremental=False, **kwargs):
869863
return blames
870864

871865
@classmethod
872-
def init(cls, path=None, mkdir=True, odbt=DefaultDBType, expand_vars=True, **kwargs):
866+
def init(cls, path=None, mkdir=True, odbt=GitCmdObjectDB, expand_vars=True, **kwargs):
873867
"""Initialize a git repository at the given path if specified
874868
875869
:param path:

‎git/test/fixtures/git_config

+16-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,25 @@
2222
url = git://gitorious.org/~martin.marcher/git-python/serverhorror.git
2323
fetch = +refs/heads/*:refs/remotes/MartinMarcher/*
2424
# can handle comments - the section name is supposed to be stripped
25+
# causes stock git-config puke
2526
[ gui ]
2627
geometry = 1316x820+219+243 207 192
2728
[branch "mainline_performance"]
2829
remote = mainline
2930
merge = refs/heads/master
31+
# section with value defined before include to be overriden
32+
[sec]
33+
var0 = value0_main
3034
[include]
31-
path = doesntexist.cfg
32-
abspath = /usr/bin/foodoesntexist.bar
35+
path = doesntexist.cfg
36+
# field should be 'path' so abspath should be ignored
37+
abspath = /usr/bin/foodoesntexist.bar
38+
path = /usr/bin/foodoesntexist.bar
39+
# should be relative to the path of this config file
40+
path = ./git_config-inc.cfg
41+
# and defined after include. According to the documentation
42+
# and behavior of git config, this should be the value since
43+
# inclusions should be processed immediately
44+
[sec]
45+
var1 = value1_main
46+

‎git/test/fixtures/git_config-inc.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[sec]
2+
var0 = value0_included
3+
var1 = value1_included
4+
[diff]
5+
tool = diff_included

‎git/test/lib/helper.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import unittest
3030

3131
TestCase = unittest.TestCase
32+
SkipTest = unittest.SkipTest
33+
skipIf = unittest.skipIf
3234

3335
ospd = osp.dirname
3436

@@ -37,7 +39,9 @@
3739

3840
__all__ = (
3941
'fixture_path', 'fixture', 'StringProcessAdapter',
40-
'with_rw_directory', 'with_rw_repo', 'with_rw_and_rw_remote_repo', 'TestBase', 'TestCase',
42+
'with_rw_directory', 'with_rw_repo', 'with_rw_and_rw_remote_repo',
43+
'TestBase', 'TestCase',
44+
'SkipTest', 'skipIf',
4145
'GIT_REPO', 'GIT_DAEMON_PORT'
4246
)
4347

@@ -139,7 +143,7 @@ def repo_creator(self):
139143
try:
140144
try:
141145
return func(self, rw_repo)
142-
except:
146+
except: # noqa E722
143147
log.info("Keeping repo after failure: %s", repo_dir)
144148
repo_dir = None
145149
raise
@@ -227,7 +231,7 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
227231
Same as with_rw_repo, but also provides a writable remote repository from which the
228232
rw_repo has been forked as well as a handle for a git-daemon that may be started to
229233
run the remote_repo.
230-
The remote repository was cloned as bare repository from the rorepo, whereas
234+
The remote repository was cloned as bare repository from the ro repo, whereas
231235
the rw repo has a working tree and was cloned from the remote repository.
232236
233237
remote_repo has two remotes: origin and daemon_origin. One uses a local url,
@@ -296,7 +300,7 @@ def remote_repo_creator(self):
296300
with cwd(rw_repo.working_dir):
297301
try:
298302
return func(self, rw_repo, rw_daemon_repo)
299-
except:
303+
except: # noqa E722
300304
log.info("Keeping repos after failure: \n rw_repo_dir: %s \n rw_daemon_repo_dir: %s",
301305
rw_repo_dir, rw_daemon_repo_dir)
302306
rw_repo_dir = rw_daemon_repo_dir = None

‎git/test/test_commit.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ def test_traversal(self):
169169
# at some point, both iterations should stop
170170
self.assertEqual(list(bfirst)[-1], first)
171171
stoptraverse = self.rorepo.commit("254d04aa3180eb8b8daf7b7ff25f010cd69b4e7d").traverse(as_edge=True)
172-
l = list(stoptraverse)
173-
self.assertEqual(len(l[0]), 2)
172+
self.assertEqual(len(next(stoptraverse)), 2)
174173

175174
# ignore self
176175
self.assertEqual(next(start.traverse(ignore_self=False)), start)

‎git/test/test_config.py

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from git.test.lib import (
1616
TestCase,
1717
fixture_path,
18+
SkipTest,
1819
)
1920
from git.test.lib import with_rw_directory
2021

@@ -88,6 +89,21 @@ def test_read_write(self):
8889
assert r_config.get(sname, oname) == val
8990
# END for each filename
9091

92+
def test_includes_order(self):
93+
with GitConfigParser(list(map(fixture_path, ("git_config", "git_config_global")))) as r_config:
94+
r_config.read() # enforce reading
95+
# Simple inclusions, again checking them taking precedence
96+
assert r_config.get_value('sec', 'var0') == "value0_included"
97+
# This one should take the git_config_global value since included
98+
# values must be considered as soon as they get them
99+
assert r_config.get_value('diff', 'tool') == "meld"
100+
try:
101+
assert r_config.get_value('sec', 'var1') == "value1_main"
102+
except AssertionError:
103+
raise SkipTest(
104+
'Known failure -- included values are not in effect right away'
105+
)
106+
91107
@with_rw_directory
92108
def test_lock_reentry(self, rw_dir):
93109
fpl = osp.join(rw_dir, 'l')

‎git/test/test_git.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
except ImportError:
3838
import mock
3939

40+
from git.compat import is_win
41+
4042

4143
class TestGit(TestBase):
4244

@@ -177,7 +179,8 @@ def test_refresh(self):
177179
self.assertRaises(GitCommandNotFound, refresh, "yada")
178180

179181
# test a good path refresh
180-
path = os.popen("which git").read().strip()
182+
which_cmd = "where" if is_win else "which"
183+
path = os.popen("{0} git".format(which_cmd)).read().strip().split('\n')[0]
181184
refresh(path)
182185

183186
def test_options_are_passed_to_git(self):

‎git/test/test_index.py

+39-33
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@
5454
import os.path as osp
5555
from git.cmd import Git
5656

57+
HOOKS_SHEBANG = "#!/usr/bin/env sh\n"
58+
59+
60+
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS, "TODO: fix hooks execution on Windows: #703")
61+
def _make_hook(git_dir, name, content, make_exec=True):
62+
"""A helper to create a hook"""
63+
hp = hook_path(name, git_dir)
64+
hpd = osp.dirname(hp)
65+
if not osp.isdir(hpd):
66+
os.mkdir(hpd)
67+
with open(hp, "wt") as fp:
68+
fp.write(HOOKS_SHEBANG + content)
69+
if make_exec:
70+
os.chmod(hp, 0o744)
71+
return hp
72+
5773

5874
class TestIndex(TestBase):
5975

@@ -834,25 +850,21 @@ def test_add_a_file_with_wildcard_chars(self, rw_dir):
834850
@with_rw_repo('HEAD', bare=True)
835851
def test_pre_commit_hook_success(self, rw_repo):
836852
index = rw_repo.index
837-
hp = hook_path('pre-commit', index.repo.git_dir)
838-
hpd = osp.dirname(hp)
839-
if not osp.isdir(hpd):
840-
os.mkdir(hpd)
841-
with open(hp, "wt") as fp:
842-
fp.write("#!/usr/bin/env sh\nexit 0")
843-
os.chmod(hp, 0o744)
853+
_make_hook(
854+
index.repo.git_dir,
855+
'pre-commit',
856+
"exit 0"
857+
)
844858
index.commit("This should not fail")
845859

846860
@with_rw_repo('HEAD', bare=True)
847861
def test_pre_commit_hook_fail(self, rw_repo):
848862
index = rw_repo.index
849-
hp = hook_path('pre-commit', index.repo.git_dir)
850-
hpd = osp.dirname(hp)
851-
if not osp.isdir(hpd):
852-
os.mkdir(hpd)
853-
with open(hp, "wt") as fp:
854-
fp.write("#!/usr/bin/env sh\necho stdout; echo stderr 1>&2; exit 1")
855-
os.chmod(hp, 0o744)
863+
hp = _make_hook(
864+
index.repo.git_dir,
865+
'pre-commit',
866+
"echo stdout; echo stderr 1>&2; exit 1"
867+
)
856868
try:
857869
index.commit("This should fail")
858870
except HookExecutionError as err:
@@ -869,35 +881,29 @@ def test_pre_commit_hook_fail(self, rw_repo):
869881
self.assertEqual(err.stderr, "\n stderr: 'stderr\n'")
870882
assert str(err)
871883
else:
872-
raise AssertionError("Should have cought a HookExecutionError")
884+
raise AssertionError("Should have caught a HookExecutionError")
873885

874886
@with_rw_repo('HEAD', bare=True)
875887
def test_commit_msg_hook_success(self, rw_repo):
876-
index = rw_repo.index
877888
commit_message = u"commit default head by Frèderic Çaufl€"
878889
from_hook_message = u"from commit-msg"
879-
880-
hp = hook_path('commit-msg', index.repo.git_dir)
881-
hpd = osp.dirname(hp)
882-
if not osp.isdir(hpd):
883-
os.mkdir(hpd)
884-
with open(hp, "wt") as fp:
885-
fp.write('#!/usr/bin/env sh\necho -n " {}" >> "$1"'.format(from_hook_message))
886-
os.chmod(hp, 0o744)
887-
890+
index = rw_repo.index
891+
_make_hook(
892+
index.repo.git_dir,
893+
'commit-msg',
894+
'echo -n " {0}" >> "$1"'.format(from_hook_message)
895+
)
888896
new_commit = index.commit(commit_message)
889-
self.assertEqual(new_commit.message, u"{} {}".format(commit_message, from_hook_message))
897+
self.assertEqual(new_commit.message, u"{0} {1}".format(commit_message, from_hook_message))
890898

891899
@with_rw_repo('HEAD', bare=True)
892900
def test_commit_msg_hook_fail(self, rw_repo):
893901
index = rw_repo.index
894-
hp = hook_path('commit-msg', index.repo.git_dir)
895-
hpd = osp.dirname(hp)
896-
if not osp.isdir(hpd):
897-
os.mkdir(hpd)
898-
with open(hp, "wt") as fp:
899-
fp.write("#!/usr/bin/env sh\necho stdout; echo stderr 1>&2; exit 1")
900-
os.chmod(hp, 0o744)
902+
hp = _make_hook(
903+
index.repo.git_dir,
904+
'commit-msg',
905+
"echo stdout; echo stderr 1>&2; exit 1"
906+
)
901907
try:
902908
index.commit("This should fail")
903909
except HookExecutionError as err:

‎git/test/test_submodule.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -920,4 +920,4 @@ class Repo(object):
920920
submodule_path = 'D:\\submodule_path'
921921
relative_path = Submodule._to_relative_path(super_repo, submodule_path)
922922
msg = '_to_relative_path should be "submodule_path" but was "%s"' % relative_path
923-
assert relative_path == 'submodule_path', msg
923+
assert relative_path == 'submodule_path', msg

‎git/test/test_util.py

+27-27
Original file line numberDiff line numberDiff line change
@@ -217,49 +217,49 @@ def test_actor(self):
217217
@ddt.data(('name', ''), ('name', 'prefix_'))
218218
def test_iterable_list(self, case):
219219
name, prefix = case
220-
l = IterableList(name, prefix)
220+
ilist = IterableList(name, prefix)
221221

222222
name1 = "one"
223223
name2 = "two"
224224
m1 = TestIterableMember(prefix + name1)
225225
m2 = TestIterableMember(prefix + name2)
226226

227-
l.extend((m1, m2))
227+
ilist.extend((m1, m2))
228228

229-
self.assertEqual(len(l), 2)
229+
self.assertEqual(len(ilist), 2)
230230

231231
# contains works with name and identity
232-
self.assertIn(name1, l)
233-
self.assertIn(name2, l)
234-
self.assertIn(m2, l)
235-
self.assertIn(m2, l)
236-
self.assertNotIn('invalid', l)
232+
self.assertIn(name1, ilist)
233+
self.assertIn(name2, ilist)
234+
self.assertIn(m2, ilist)
235+
self.assertIn(m2, ilist)
236+
self.assertNotIn('invalid', ilist)
237237

238238
# with string index
239-
self.assertIs(l[name1], m1)
240-
self.assertIs(l[name2], m2)
239+
self.assertIs(ilist[name1], m1)
240+
self.assertIs(ilist[name2], m2)
241241

242242
# with int index
243-
self.assertIs(l[0], m1)
244-
self.assertIs(l[1], m2)
243+
self.assertIs(ilist[0], m1)
244+
self.assertIs(ilist[1], m2)
245245

246246
# with getattr
247-
self.assertIs(l.one, m1)
248-
self.assertIs(l.two, m2)
247+
self.assertIs(ilist.one, m1)
248+
self.assertIs(ilist.two, m2)
249249

250250
# test exceptions
251-
self.failUnlessRaises(AttributeError, getattr, l, 'something')
252-
self.failUnlessRaises(IndexError, l.__getitem__, 'something')
251+
self.failUnlessRaises(AttributeError, getattr, ilist, 'something')
252+
self.failUnlessRaises(IndexError, ilist.__getitem__, 'something')
253253

254254
# delete by name and index
255-
self.failUnlessRaises(IndexError, l.__delitem__, 'something')
256-
del(l[name2])
257-
self.assertEqual(len(l), 1)
258-
self.assertNotIn(name2, l)
259-
self.assertIn(name1, l)
260-
del(l[0])
261-
self.assertNotIn(name1, l)
262-
self.assertEqual(len(l), 0)
263-
264-
self.failUnlessRaises(IndexError, l.__delitem__, 0)
265-
self.failUnlessRaises(IndexError, l.__delitem__, 'something')
255+
self.failUnlessRaises(IndexError, ilist.__delitem__, 'something')
256+
del(ilist[name2])
257+
self.assertEqual(len(ilist), 1)
258+
self.assertNotIn(name2, ilist)
259+
self.assertIn(name1, ilist)
260+
del(ilist[0])
261+
self.assertNotIn(name1, ilist)
262+
self.assertEqual(len(ilist), 0)
263+
264+
self.failUnlessRaises(IndexError, ilist.__delitem__, 0)
265+
self.failUnlessRaises(IndexError, ilist.__delitem__, 'something')

‎git/util.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,15 @@ def assure_directory_exists(path, is_file=False):
188188

189189

190190
def _get_exe_extensions():
191-
try:
192-
winprog_exts = tuple(p.upper() for p in os.environ['PATHEXT'].split(os.pathsep))
193-
except:
194-
winprog_exts = ('.BAT', 'COM', '.EXE')
195-
196-
return winprog_exts
191+
PATHEXT = os.environ.get('PATHEXT', None)
192+
return tuple(p.upper() for p in PATHEXT.split(os.pathsep)) \
193+
if PATHEXT \
194+
else (('.BAT', 'COM', '.EXE') if is_win else ())
197195

198196

199197
def py_where(program, path=None):
200198
# From: http://stackoverflow.com/a/377028/548792
201-
try:
202-
winprog_exts = tuple(p.upper() for p in os.environ['PATHEXT'].split(os.pathsep))
203-
except:
204-
winprog_exts = is_win and ('.BAT', 'COM', '.EXE') or ()
199+
winprog_exts = _get_exe_extensions()
205200

206201
def is_exec(fpath):
207202
return osp.isfile(fpath) and os.access(fpath, os.X_OK) and (
@@ -347,7 +342,7 @@ def expand_path(p, expand_vars=True):
347342
if expand_vars:
348343
p = osp.expandvars(p)
349344
return osp.normpath(osp.abspath(p))
350-
except:
345+
except Exception:
351346
return None
352347

353348
#} END utilities

‎release-verification-key.asc

+1,731-106
Large diffs are not rendered by default.

‎setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def _stamp_version(filename):
101101
package_data={'git.test': ['fixtures/*']},
102102
package_dir={'git': 'git'},
103103
license="BSD License",
104+
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
104105
requires=['gitdb2 (>=2.0.0)'],
105106
install_requires=install_requires,
106107
test_requirements=test_requires + install_requires,

0 commit comments

Comments
 (0)
Please sign in to comment.