1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/changed2/__init__.py Tue Jul 03 22:43:21 2012 +0200
1.3 @@ -0,0 +1,12 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +def f():
1.7 + import changed2.modifier
1.8 +
1.9 +def getx():
1.10 + return x
1.11 +
1.12 +x = 123
1.13 +f() # import modifier which changes x in this module
1.14 +
1.15 +# vim: tabstop=4 expandtab shiftwidth=4
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/tests/changed2/modifier.py Tue Jul 03 22:43:21 2012 +0200
2.3 @@ -0,0 +1,17 @@
2.4 +#!/usr/bin/env python
2.5 +
2.6 +import changed2 # access the package root
2.7 +
2.8 +def change():
2.9 +
2.10 + "Change x in the partially imported module."
2.11 +
2.12 + changed2.x = 456
2.13 +
2.14 +change()
2.15 +
2.16 +# Attempt to confuse the identity of changed2 for the function.
2.17 +
2.18 +changed2 = None
2.19 +
2.20 +# vim: tabstop=4 expandtab shiftwidth=4
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tests/changed_globals2.py Tue Jul 03 22:43:21 2012 +0200
3.3 @@ -0,0 +1,8 @@
3.4 +#!/usr/bin/env python
3.5 +
3.6 +import changed2
3.7 +
3.8 +result1_456 = changed2.x
3.9 +result2_456 = changed2.getx()
3.10 +
3.11 +# vim: tabstop=4 expandtab shiftwidth=4