Skip to content

Commit d47ee87

Browse files
committed
Run without distutils for Python 3.12
1 parent aac3c6e commit d47ee87

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset_test_it.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import logging
2323
import os
24+
import sys
2425
import unittest
2526
import uuid
2627

@@ -47,12 +48,14 @@ def test_run_example_with_setup_file(self):
4748
extra_args = {
4849
'coordinate_output': coordinate_output,
4950
'grid_size': self.GRID_SIZE,
50-
'setup_file': os.path.normpath(
51-
os.path.join(os.path.dirname(__file__), '..', 'setup.py')),
5251
'on_success_matcher': all_of(PipelineStateMatcher(PipelineState.DONE)),
5352
}
54-
args = pipeline.get_full_options_as_args(**extra_args)
53+
# distutils was removed from Python 3.12
54+
if sys.version_info < (3, 12):
55+
extra_args['setup_file'] = os.path.normpath(
56+
os.path.join(os.path.dirname(__file__), '..', 'setup.py'))
5557

58+
args = pipeline.get_full_options_as_args(**extra_args)
5659
juliaset.run(args)
5760

5861

0 commit comments

Comments
 (0)