mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Update wandbox script to use https endpoint and Python3
This commit is contained in:
		| @@ -1,16 +1,18 @@ | |||||||
| #!/usr/bin/env python | #!/usr/bin/env python3 | ||||||
|  |  | ||||||
| import json | import json | ||||||
| import os | import os | ||||||
| import urllib2 | import urllib.request | ||||||
|  |  | ||||||
| from scriptCommon import catchPath | from scriptCommon import catchPath | ||||||
|  |  | ||||||
| def upload(options): | def upload(options): | ||||||
|     request = urllib2.Request('http://melpon.org/wandbox/api/compile.json') |     request = urllib.request.Request('https://melpon.org/wandbox/api/compile.json', method='POST') | ||||||
|     request.add_header('Content-Type', 'application/json') |     json_bytes = json.dumps(options).encode('utf-8') | ||||||
|     response = urllib2.urlopen(request, json.dumps(options)) |     request.add_header('Content-Type', 'application/json; charset=utf-8') | ||||||
|     return json.loads(response.read()) |     request.add_header('Content-Length', len(json_bytes)) | ||||||
|  |     response = urllib.request.urlopen(request, json_bytes) | ||||||
|  |     return json.loads(response.read().decode('utf-8')) | ||||||
|  |  | ||||||
| main_file = ''' | main_file = ''' | ||||||
| #define CATCH_CONFIG_MAIN  // This tells Catch to provide a main() - only do this in one cpp file | #define CATCH_CONFIG_MAIN  // This tells Catch to provide a main() - only do this in one cpp file | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský