Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec1ae96

Browse files
committed
Merge pull request#10 from tonyroberts/travis-ci
fix all unit tests and add python 2.6 build to travis
2 parents706e590 +fd309f5 commitec1ae96

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

‎.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
language:python
22
python:
3+
-2.6
34
-2.7
45
before_install:
56
-sudo apt-get install software-properties-common

‎pythonnet/setupmono.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
fromdistutils.command.build_extimportbuild_ext
77
fromdistutils.sysconfigimportget_config_vars
88
fromplatformimportarchitecture
9-
fromsubprocessimportcheck_output,check_call
9+
fromsubprocessimportPopen,CalledProcessError,PIPE,check_call
1010
importshutil
1111
importsys
1212
importos
@@ -77,10 +77,10 @@ def build_extension(self, ext):
7777

7878

7979
def_build_monoclr(self,ext):
80-
mono_libs=check_output("pkg-config --libs mono-2",shell=True)
81-
mono_cflags=check_output("pkg-config --cflags mono-2",shell=True)
82-
glib_libs=check_output("pkg-config --libs glib-2.0",shell=True)
83-
glib_cflags=check_output("pkg-config --cflags glib-2.0",shell=True)
80+
mono_libs=_check_output("pkg-config --libs mono-2",shell=True)
81+
mono_cflags=_check_output("pkg-config --cflags mono-2",shell=True)
82+
glib_libs=_check_output("pkg-config --libs glib-2.0",shell=True)
83+
glib_cflags=_check_output("pkg-config --cflags glib-2.0",shell=True)
8484
cflags=mono_cflags.strip()+" "+glib_cflags.strip()
8585
libs=mono_libs.strip()+" "+glib_libs.strip()
8686

@@ -129,6 +129,22 @@ def _build_monoclr(self, ext):
129129
debug=self.debug)
130130

131131

132+
def_check_output(*popenargs,**kwargs):
133+
"""subprocess.check_output from python 2.7.
134+
Added here to support building for earlier versions
135+
of Python.
136+
"""
137+
process=Popen(stdout=PIPE,*popenargs,**kwargs)
138+
output,unused_err=process.communicate()
139+
retcode=process.poll()
140+
ifretcode:
141+
cmd=kwargs.get("args")
142+
ifcmdisNone:
143+
cmd=popenargs[0]
144+
raiseCalledProcessError(retcode,cmd,output=output)
145+
returnoutput
146+
147+
132148
if__name__=="__main__":
133149
setup(name="pythonnet",
134150
ext_modules=[

‎pythonnet/src/runtime/converter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,14 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result,
540540
if(Exceptions.ErrorOccurred()){
541541
gotooverflow;
542542
}
543+
544+
IntPtrcheck=Runtime.PyLong_FromUnsignedLong(ui);
545+
interr=Runtime.PyObject_Compare(check,op);
546+
Runtime.Decref(check);
547+
if(0!=err||Exceptions.ErrorOccurred()){
548+
gotooverflow;
549+
}
550+
543551
result=ui;
544552
returntrue;
545553

‎pythonnet/src/tests/runtests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ def main(verbosity=1):
6262
module=__import__(name)
6363
suite.addTests((module.test_suite(),))
6464

65-
unittest.TextTestRunner(verbosity=verbosity).run(suite)
65+
result=unittest.TextTestRunner(verbosity=verbosity).run(suite)
66+
ifnotresult.wasSuccessful():
67+
raiseException("Tests failed")
6668

6769
if__name__=='__main__':
6870
main(1)
6971
if'--pause'insys.argv:
7072
print"Press enter to continue"
7173
raw_input()
74+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp