Skip to content

Commit 2ecc938

Browse files
authored
Merge branch 'master' into patch
2 parents 9222e6f + 4968832 commit 2ecc938

File tree

5 files changed

+246
-90
lines changed

5 files changed

+246
-90
lines changed

AUTHORS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
- Xavier Dupré ([@sdpython](https://github.com/sdpython))
4545
- Zane Purvis ([@zanedp](https://github.com/zanedp))
4646
- ([@bltribble](https://github.com/bltribble))
47+
- ([@civilx64](https://github.com/civilx64))
48+
- ([@GSPP](https://github.com/GSPP))
4749
- ([@omnicognate](https://github.com/omnicognate))
4850
- ([@rico-chet](https://github.com/rico-chet))
4951
- ([@rmadsen-ks](https://github.com/rmadsen-ks))
5052
- ([@stonebig](https://github.com/stonebig))
5153
- ([@testrunner123](https://github.com/testrunner123))
52-
- ([@GSPP](https://github.com/GSPP))
53-
- ([@amos402](https://github.com/amos402))
54-
54+
- ([@amos402](https://github.com/amos402))

CHANGELOG.md

Lines changed: 179 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -13,162 +13,164 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1313
Currently there two side-by-side build systems that produces the same output (net40) from the same sources.
1414
After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
1515
- NUnit upgraded to 3.7 (eliminates travis-ci random bug)
16-
- Added `clr.GetClrType` (#432, #433)
17-
- Allowed passing `None` for nullable args (#460)
18-
- Added keyword arguments based on C# syntax for calling CPython methods (#461)
19-
- Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger (#443)
16+
- Added `clr.GetClrType` ([#432][i432])([#433][p433])
17+
- Allowed passing `None` for nullable args ([#460][p460])
18+
- Added keyword arguments based on C# syntax for calling CPython methods ([#461][p461])
19+
- Catches exceptions thrown in C# iterators (yield returns) and rethrows them in python ([#475][i475])([#693][p693])
20+
- Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger ([#443][i443])([#690][p690])
21+
- Incorporated reference-style links to issues and pull requests in the CHANGELOG ([#608][i608])
2022

2123
### Changed
2224

2325
### Fixed
2426

25-
- Fixed Visual Studio 2017 compat (#434) for setup.py
27+
- Fixed Visual Studio 2017 compat ([#434][i434]) for setup.py
2628
- Fixed crash on exit of the Python interpreter if a python class
2729
derived from a .NET class has a `__namespace__` or `__assembly__`
28-
attribute (#481)
29-
- Fixed conversion of 'float' and 'double' values (#486)
30-
- Fixed 'clrmethod' for python 2 (#492)
31-
- Fixed double calling of constructor when deriving from .NET class (#495)
32-
- Fixed `clr.GetClrType` when iterating over `System` members (#607)
33-
- Fixed `LockRecursionException` when loading assemblies (#627)
34-
- Fixed errors breaking .NET Remoting on method invoke (#276)
35-
- Fixed PyObject.GetHashCode (#676)
30+
attribute ([#481][i481])
31+
- Fixed conversion of 'float' and 'double' values ([#486][i486])
32+
- Fixed 'clrmethod' for python 2 ([#492][i492])
33+
- Fixed double calling of constructor when deriving from .NET class ([#495][i495])
34+
- Fixed `clr.GetClrType` when iterating over `System` members ([#607][p607])
35+
- Fixed `LockRecursionException` when loading assemblies ([#627][i627])
36+
- Fixed errors breaking .NET Remoting on method invoke ([#276][i276])
37+
- Fixed PyObject.GetHashCode ([#676][i676])
3638

3739

3840
## [2.3.0][] - 2017-03-11
3941

4042
### Added
4143

42-
- Added Code Coverage (#345)
43-
- Added `PySys_SetArgvEx` (#347)
44-
- Added XML Documentation (#349)
45-
- Added `Embedded_Tests` on AppVeyor (#224)(#353)
46-
- Added `Embedded_Tests` on Travis (#224)(#391)
47-
- Added PY3 settings to solution configuration-manager (#346)
48-
- Added `Slack` (#384)(#383)(#386)
44+
- Added Code Coverage ([#345][p345])
45+
- Added `PySys_SetArgvEx` ([#347][p347])
46+
- Added XML Documentation ([#349][p349])
47+
- Added `Embedded_Tests` on AppVeyor ([#224][i224])([#353][p353])
48+
- Added `Embedded_Tests` on Travis ([#224][i224])([#391][p391])
49+
- Added PY3 settings to solution configuration-manager ([#346][p346])
50+
- Added `Slack` ([#384][p384])([#383][i383])([#386][p386])
4951
- Added function of passing an arbitrary .NET object as the value
50-
of an attribute of `PyObject` (#370)(#373)
51-
- Added `Coverity scan` (#390)
52-
- Added `bumpversion` for version control (#319)(#398)
53-
- Added `tox` for local testing (#345)
52+
of an attribute of `PyObject` ([#370][i370])([#373][p373])
53+
- Added `Coverity scan` ([#390][i390])
54+
- Added `bumpversion` for version control ([#319][i319])([#398][p398])
55+
- Added `tox` for local testing ([#345][p345])
5456
- Added `requirements.txt`
55-
- Added to `PythonEngine` methods `Eval` and `Exec` (#389)
56-
- Added implementations of `ICustomMarshal` (#407)
57-
- Added docker images (#322)
58-
- Added hooks in `pyinstaller` and `cx_freeze` for `pythonnet` (#66)
57+
- Added to `PythonEngine` methods `Eval` and `Exec` ([#389][p389])
58+
- Added implementations of `ICustomMarshal` ([#407][p407])
59+
- Added docker images ([#322][i322])
60+
- Added hooks in `pyinstaller` and `cx_freeze` for `pythonnet` ([#66][i66])
5961

6062
### Changed
6163

62-
- Refactored python `unittests` (#329)
63-
- Refactored python `setup.py` (#337)
64-
- Refactored remaining of Build Directives on `runtime.cs` (#339)
65-
- Refactored `Embedded_Tests` to make easier to write tests (#369)
66-
- Changed `unittests` to `pytest` (#368)
67-
- Upgraded NUnit framework from `2.6.3` to `3.5.0` (#341)
68-
- Downgraded NUnit framework from `3.5.0` to `2.6.4` (#353)
69-
- Upgraded NUnit framework from `2.6.4` to `3.6.0` (#371)
70-
- Unfroze Mono version on Travis (#345)
71-
- Changed `conda.recipe` build to only pull-requests (#345)
72-
- Combine `Py_DEBUG` and `PYTHON_WITH_PYDEBUG` flags (#362)
64+
- Refactored python `unittests` ([#329][p329])
65+
- Refactored python `setup.py` ([#337][p337])
66+
- Refactored remaining of Build Directives on `runtime.cs` ([#339][p339])
67+
- Refactored `Embedded_Tests` to make easier to write tests ([#369][p369])
68+
- Changed `unittests` to `pytest` ([#368][p368])
69+
- Upgraded NUnit framework from `2.6.3` to `3.5.0` ([#341][p341])
70+
- Downgraded NUnit framework from `3.5.0` to `2.6.4` ([#353][p353])
71+
- Upgraded NUnit framework from `2.6.4` to `3.6.0` ([#371][p371])
72+
- Unfroze Mono version on Travis ([#345][p345])
73+
- Changed `conda.recipe` build to only pull-requests ([#345][p345])
74+
- Combine `Py_DEBUG` and `PYTHON_WITH_PYDEBUG` flags ([#362][i362])
7375

7476
### Deprecated
7577

76-
- Deprecated `RunString` (#401)
78+
- Deprecated `RunString` ([#401][i401])
7779

7880
### Fixed
7981

80-
- Fixed crash during Initialization (#262)(#343)
81-
- Fixed crash during Shutdown (#365)
82+
- Fixed crash during Initialization ([#262][i262])([#343][p343])
83+
- Fixed crash during Shutdown ([#365][p365])
8284
- Fixed multiple build warnings
83-
- Fixed method signature match for Object Type (#203)(#377)
84-
- Fixed outdated version number in AssemblyInfo (#398)
85-
- Fixed wrong version number in `conda.recipe` (#398)
85+
- Fixed method signature match for Object Type ([#203][i203])([#377][p377])
86+
- Fixed outdated version number in AssemblyInfo ([#398][p398])
87+
- Fixed wrong version number in `conda.recipe` ([#398][p398])
8688
- Fixed fixture location for Python tests and `Embedded_Tests`
87-
- Fixed `PythonException` crash during Shutdown (#400)
88-
- Fixed `AppDomain` unload during GC (#397)(#400)
89-
- Fixed `Py_Main` & `PySys_SetArgvEx` `no mem error` on `UCS4/PY3` (#399)
90-
- Fixed `Python.Runtime.dll.config` on macOS (#120)
91-
- Fixed crash on `PythonEngine.Version` (#413)
92-
- Fixed `PythonEngine.PythonPath` issues (#179)(#414)(#415)
89+
- Fixed `PythonException` crash during Shutdown ([#400][p400])
90+
- Fixed `AppDomain` unload during GC ([#397][i397])([#400][p400])
91+
- Fixed `Py_Main` & `PySys_SetArgvEx` `no mem error` on `UCS4/PY3` ([#399][p399])
92+
- Fixed `Python.Runtime.dll.config` on macOS ([#120][i120])
93+
- Fixed crash on `PythonEngine.Version` ([#413][i413])
94+
- Fixed `PythonEngine.PythonPath` issues ([#179][i179])([#414][i414])([#415][p415])
9395

9496
### Removed
9597

96-
- Removed `six` dependency for `unittests` (#329)
97-
- Removed `Mono.Unix` dependency for `UCS4` (#360)
98+
- Removed `six` dependency for `unittests` ([#329][p329])
99+
- Removed `Mono.Unix` dependency for `UCS4` ([#360][p360])
98100
- Removed need for `Python.Runtime.dll.config`
99-
- Removed PY32 build option `PYTHON_WITH_WIDE_UNICODE` (#417)
101+
- Removed PY32 build option `PYTHON_WITH_WIDE_UNICODE` ([#417][i417])
100102

101103
## [2.2.2][] - 2017-01-29
102104

103105
### Fixed
104106

105-
- Missing files from packaging (#336)
107+
- Missing files from packaging ([#336][i336])
106108

107109
## [2.2.1][] - 2017-01-26
108110

109111
- `v2.2.0` had a release issue on PyPi. Bumped to `v2.2.1`
110112

111113
### Added
112114

113-
- Python 3.6 support (#310)
114-
- Added `__version__` to module (#312)
115-
- Added `conda` recipe (#281)
116-
- Nuget update on build (#268)
117-
- Added `__cause__` attribute on exception (#287)
115+
- Python 3.6 support ([#310][p310])
116+
- Added `__version__` to module ([#312][p312])
117+
- Added `conda` recipe ([#281][p281])
118+
- Nuget update on build ([#268][p268])
119+
- Added `__cause__` attribute on exception ([#287][p287])
118120

119121
### Changed
120122

121-
- License to MIT (#314)
122-
- Project clean-up (#320)
123+
- License to MIT ([#314][p314])
124+
- Project clean-up ([#320][p320])
123125
- Refactor `#if` directives
124-
- Rename Decref/Incref to XDecref/XIncre (#275)
125-
- Remove printing if Decref is called with NULL (#275)
126+
- Rename Decref/Incref to XDecref/XIncre ([#275][p275])
127+
- Remove printing if Decref is called with NULL ([#275][p275])
126128

127129
### Removed
128130

129-
- Python 2.6 support (#270)
130-
- Python 3.2 support (#270)
131+
- Python 2.6 support ([#270][i270])
132+
- Python 3.2 support ([#270][i270])
131133

132134
### Fixed
133135

134-
- Fixed `isinstance` refcount_leak (#273)
135-
- Comparison Operators (#294)
136-
- Improved Linux support (#300)
137-
- Exception pickling (#286)
136+
- Fixed `isinstance` refcount_leak ([#273][p273])
137+
- Comparison Operators ([#294][p294])
138+
- Improved Linux support ([#300][p300])
139+
- Exception pickling ([#286][p286])
138140

139141
## [2.2.0-dev1][] - 2016-09-19
140142

141143
### Changed
142144

143-
- Switch to C# 6.0 (#219)
144-
- `setup.py` improvements for locating build tools (#208)
145-
- unmanaged exports updated (#206)
146-
- Mono update pinned to 4.2.4.4 (#233)
145+
- Switch to C# 6.0 ([#219][p219])
146+
- `setup.py` improvements for locating build tools ([#208][p208])
147+
- unmanaged exports updated ([#206][p206])
148+
- Mono update pinned to 4.2.4.4 ([#233][p233])
147149

148150
### Fixed
149151

150-
- Fixed relative imports (#219)
151-
- Fixed recursive types (#250)
152-
- Demo fix - stream reading (#225)
152+
- Fixed relative imports ([#219][p219])
153+
- Fixed recursive types ([#250][p250])
154+
- Demo fix - stream reading ([#225][p225])
153155

154156
## [2.1.0][] - 2016-04-12
155157

156158
### Added
157159

158-
- Added Python 3.2 support. (#78)
159-
- Added Python 3.3 support. (#78)
160-
- Added Python 3.4 support. (#78)
161-
- Added Python 3.5 support. (#163)
162-
- Managed types can be sub-classed in Python (#78)
163-
- Uses dynamic objects for cleaner code when embedding Python (#78)
160+
- Added Python 3.2 support. ([#78][p78])
161+
- Added Python 3.3 support. ([#78][p78])
162+
- Added Python 3.4 support. ([#78][p78])
163+
- Added Python 3.5 support. ([#163][p163])
164+
- Managed types can be sub-classed in Python ([#78][p78])
165+
- Uses dynamic objects for cleaner code when embedding Python ([#78][p78])
164166

165167
### Changed
166168

167-
- Better Linux support (with or without --enable-shared option) (#78)
169+
- Better Linux support (with or without --enable-shared option) ([#78][p78])
168170

169171
### Removed
170172

171-
- Implicit Type Casting (#131)
173+
- Implicit Type Casting ([#131][i131])
172174

173175
## [2.0.0][] - 2015-06-26
174176

@@ -588,3 +590,95 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
588590
[2.0.0]: ../../compare/1.0...v2.0.0
589591

590592
[1.0.0]: https://github.com/pythonnet/pythonnet/releases/tag/1.0
593+
594+
[i608]: https://github.com/pythonnet/pythonnet/issues/608
595+
[i443]: https://github.com/pythonnet/pythonnet/issues/443
596+
[p690]: https://github.com/pythonnet/pythonnet/pull/690
597+
[i475]: https://github.com/pythonnet/pythonnet/issues/475
598+
[p693]: https://github.com/pythonnet/pythonnet/pull/693
599+
[i432]: https://github.com/pythonnet/pythonnet/issues/432
600+
[p433]: https://github.com/pythonnet/pythonnet/pull/433
601+
[p460]: https://github.com/pythonnet/pythonnet/pull/460
602+
[p461]: https://github.com/pythonnet/pythonnet/pull/461
603+
[p433]: https://github.com/pythonnet/pythonnet/pull/433
604+
[i434]: https://github.com/pythonnet/pythonnet/issues/434
605+
[i481]: https://github.com/pythonnet/pythonnet/issues/481
606+
[i486]: https://github.com/pythonnet/pythonnet/issues/486
607+
[i492]: https://github.com/pythonnet/pythonnet/issues/492
608+
[i495]: https://github.com/pythonnet/pythonnet/issues/495
609+
[p607]: https://github.com/pythonnet/pythonnet/pull/607
610+
[i627]: https://github.com/pythonnet/pythonnet/issues/627
611+
[i276]: https://github.com/pythonnet/pythonnet/issues/276
612+
[i676]: https://github.com/pythonnet/pythonnet/issues/676
613+
[p345]: https://github.com/pythonnet/pythonnet/pull/345
614+
[p347]: https://github.com/pythonnet/pythonnet/pull/347
615+
[p349]: https://github.com/pythonnet/pythonnet/pull/349
616+
[i224]: https://github.com/pythonnet/pythonnet/issues/224
617+
[p353]: https://github.com/pythonnet/pythonnet/pull/353
618+
[p391]: https://github.com/pythonnet/pythonnet/pull/391
619+
[p346]: https://github.com/pythonnet/pythonnet/pull/346
620+
[p384]: https://github.com/pythonnet/pythonnet/pull/384
621+
[i383]: https://github.com/pythonnet/pythonnet/issues/383
622+
[p386]: https://github.com/pythonnet/pythonnet/pull/386
623+
[i370]: https://github.com/pythonnet/pythonnet/issues/370
624+
[p373]: https://github.com/pythonnet/pythonnet/pull/373
625+
[i390]: https://github.com/pythonnet/pythonnet/issues/390
626+
[i319]: https://github.com/pythonnet/pythonnet/issues/319
627+
[p398]: https://github.com/pythonnet/pythonnet/pull/398
628+
[p345]: https://github.com/pythonnet/pythonnet/pull/345
629+
[p389]: https://github.com/pythonnet/pythonnet/pull/389
630+
[p407]: https://github.com/pythonnet/pythonnet/pull/407
631+
[i322]: https://github.com/pythonnet/pythonnet/issues/322
632+
[i66]: https://github.com/pythonnet/pythonnet/issues/66
633+
[p329]: https://github.com/pythonnet/pythonnet/pull/329
634+
[p337]: https://github.com/pythonnet/pythonnet/pull/337
635+
[p339]: https://github.com/pythonnet/pythonnet/pull/339
636+
[p369]: https://github.com/pythonnet/pythonnet/pull/369
637+
[p368]: https://github.com/pythonnet/pythonnet/pull/368
638+
[p341]: https://github.com/pythonnet/pythonnet/pull/341
639+
[p353]: https://github.com/pythonnet/pythonnet/pull/353
640+
[p371]: https://github.com/pythonnet/pythonnet/pull/371
641+
[p345]: https://github.com/pythonnet/pythonnet/pull/345
642+
[i362]: https://github.com/pythonnet/pythonnet/issues/362
643+
[i401]: https://github.com/pythonnet/pythonnet/issues/401
644+
[i262]: https://github.com/pythonnet/pythonnet/issues/262
645+
[p343]: https://github.com/pythonnet/pythonnet/pull/343
646+
[p365]: https://github.com/pythonnet/pythonnet/pull/365
647+
[i203]: https://github.com/pythonnet/pythonnet/issues/203
648+
[p377]: https://github.com/pythonnet/pythonnet/pull/377
649+
[p398]: https://github.com/pythonnet/pythonnet/pull/398
650+
[p400]: https://github.com/pythonnet/pythonnet/pull/400
651+
[i397]: https://github.com/pythonnet/pythonnet/issues/397
652+
[p399]: https://github.com/pythonnet/pythonnet/pull/399
653+
[i120]: https://github.com/pythonnet/pythonnet/issues/120
654+
[i413]: https://github.com/pythonnet/pythonnet/issues/413
655+
[i179]: https://github.com/pythonnet/pythonnet/issues/179
656+
[i414]: https://github.com/pythonnet/pythonnet/issues/414
657+
[p415]: https://github.com/pythonnet/pythonnet/pull/415
658+
[p329]: https://github.com/pythonnet/pythonnet/pull/329
659+
[p360]: https://github.com/pythonnet/pythonnet/pull/360
660+
[i417]: https://github.com/pythonnet/pythonnet/issues/417
661+
[i336]: https://github.com/pythonnet/pythonnet/issues/336
662+
[p310]: https://github.com/pythonnet/pythonnet/pull/310
663+
[p312]: https://github.com/pythonnet/pythonnet/pull/312
664+
[p281]: https://github.com/pythonnet/pythonnet/pull/281
665+
[p268]: https://github.com/pythonnet/pythonnet/pull/268
666+
[p287]: https://github.com/pythonnet/pythonnet/pull/287
667+
[p314]: https://github.com/pythonnet/pythonnet/pull/314
668+
[p320]: https://github.com/pythonnet/pythonnet/pull/320
669+
[p275]: https://github.com/pythonnet/pythonnet/pull/275
670+
[i270]: https://github.com/pythonnet/pythonnet/issues/270
671+
[p273]: https://github.com/pythonnet/pythonnet/pull/273
672+
[p294]: https://github.com/pythonnet/pythonnet/pull/294
673+
[p300]: https://github.com/pythonnet/pythonnet/pull/300
674+
[p286]: https://github.com/pythonnet/pythonnet/pull/286
675+
[p219]: https://github.com/pythonnet/pythonnet/pull/219
676+
[p208]: https://github.com/pythonnet/pythonnet/pull/208
677+
[p206]: https://github.com/pythonnet/pythonnet/pull/206
678+
[p233]: https://github.com/pythonnet/pythonnet/pull/233
679+
[p219]: https://github.com/pythonnet/pythonnet/pull/219
680+
[p250]: https://github.com/pythonnet/pythonnet/pull/250
681+
[p225]: https://github.com/pythonnet/pythonnet/pull/225
682+
[p78]: https://github.com/pythonnet/pythonnet/pull/78
683+
[p163]: https://github.com/pythonnet/pythonnet/pull/163
684+
[i131]: https://github.com/pythonnet/pythonnet/issues/131

src/runtime/iterator.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@ public Iterator(IEnumerator e)
2323
public static IntPtr tp_iternext(IntPtr ob)
2424
{
2525
var self = GetManagedObject(ob) as Iterator;
26-
if (!self.iter.MoveNext())
26+
try
2727
{
28-
Exceptions.SetError(Exceptions.StopIteration, Runtime.PyNone);
28+
if (!self.iter.MoveNext())
29+
{
30+
Exceptions.SetError(Exceptions.StopIteration, Runtime.PyNone);
31+
return IntPtr.Zero;
32+
}
33+
}
34+
catch (Exception e)
35+
{
36+
if (e.InnerException != null)
37+
{
38+
e = e.InnerException;
39+
}
40+
Exceptions.SetError(e);
2941
return IntPtr.Zero;
3042
}
3143
object item = self.iter.Current;

0 commit comments

Comments
 (0)